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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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