Calculate and print bills for the city water company

Assignment Help Computer Engineering
Reference no: EM132212065

Question :

Write a program using a switch statement to calculate and print bills for the city water company. The rates vary, depending on whether the use is residential, commercial, or industrial.

A code of R means residential use, a code of C means commercial use, and a code of I means industrial use.

Charges are computed as follows:

R: $7.55 flat fee plus 0.013 per cubic foot of water used.

C: $6.00 flat fee for the first 1000 cubic feet (or amount less than 1000 cubic feet) used and $0.02 for each additional cubic foot above 1000.

I: $12.00 flat fee for the first 500 cubic feet or amount less than 500 cubic feet), $0.01 for each additional cubic foot between 500 and 3000, and $0.025 for each additional cubic foot above 3000.

Prompt the user to enter the number of cubic feet of water used and the use code (entered as a character), and calculate and display the amount of the bill due from the customer, displayed with two decimal digits.

The use code will be the switch variable. The program should allow for entry of upper or lower case code characters and should include an error message (default) for entry of an invalid code character.

When the program is working, modify it using a while or do...while loop so that the program will continue prompting the user to see if another bill is to be calculated.

For example, suppose that a number of cubic feet is entered and user specifies that the type of use is commercial. After the amount of the bill is printed the user will be asked if he wants to do another calculation.

He might enter Y (or 1) to continue or N (or 0) to quit. Include entry of the amount of water as well as the use code in the loop.

Reference no: EM132212065

Questions Cloud

How might the computer affect document revision : What are some basic principles of effective document design? How might the computer affect document revision?
Describe the historical development of the humanities : Describe the historical development of the humanities from the pre-historic era to the present. Identify significant cultural developments from a variety.
What is the pace of technological change in health care : What is the pace of technological change in health care? We analyzed various ways to organize a firm. what makes each of them unappealing?
Infrastructural decisions in mcdonald operations strategy : What are the most important structural and infrastructural decisions in McDonald's operations strategy?
Calculate and print bills for the city water company : Write a program using a switch statement to calculate and print bills for the city water company.
Compute the probability of all seven being large cap : A stock portfolio contains 20 stocks. Of these stocks, 10 are considered "large-cap" stocks, Compute the probability of all 7 being large cap.
Write pseudocode to add one increment of time : Write pseudocode to add one increment of time DELTA_T for each cycle to get a new value of TOTAL for each cycle.
How a family who has sensitivities within their culture : We are communicating how a family who has sensitivities within their culture have an impact on the social policy of child welfare.
Purpose of corporate social responsibility : Describe the term and purpose of Corporate Social Responsibility.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Construct an e-r diagram for the registrars office

Construct an E-R diagram for the registrar's office. Document all assumptions that you make about the mapping constraints.

  Determine whether the given mersenne numbers are primes

Determine whether the following Mersenne numbers are primes: M. M29. and M31. Can this fact be used for primarily testing? Explain.

  Write a function called truncate

Write a function called truncate. It is passed 2 parameters, a float f and an integer d.

  Paste image of linear programming results window

A linear programming problem cost minimization problem has objective function: Minimize X +Y. Use QM for Windows to plot the feasible region. Paste image of Linear Programming Results window and Solution List window here

  Explaining what is e-commerce and mobile technology

Your company is experiencing decline in business because of competition. Your manager thinks they may be able to turn the company around if they can get help.

  You are not required to comprise any constructors

using a personal computer as a base model write a c syntactically correct class definition demonstrating composition.

  Define business continuity and disaster recovery

Cloud Services for Business Continuity and Disaster Recovery: Define business continuity and disaster recovery in the context of the cloud services.

  Define five properties of controls

Are Integers and Strings considered objects in VB? Elaborate.

  Sapient is an international company based in massachusetts

sapient is an international company based in massachusetts. it has developed a unique and innovative agile methodology

  Create a diagram of the given error-control scenario

Create a diagram of this error-control scenario, and show the response(s) that Station B will send if the second packet is lost in the network.

  Display a message indicating whether the person

If the BMI valu is greater than 25,the person is considered to be overweight. I got the solution for the pseudocode but the flowchart is a little bit confusing.

  Question 1a define the term concurrency and no global clock

question 1a define the term concurrency and no global clock in distributed systemsb transparency is defined as the

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd