Question: Purpose: Use Visual Studio to create, edit, debug and compile a simple C program. Scenario: The cost of using water is determined based on how
Purpose: Use Visual Studio to create, edit, debug and compile a simple C program. Scenario: The cost of using water is determined based on how much is used during the billing period. The higher the amounts of water consumed the more expensive it becomes. Create a program that accepts a customers starting and ending meter readings and calculates the amount of the water bill. Inputs: 1) The starting meter reading. 2) The ending meter reading. Processing: 1) Determine the amount of the water bill according to the following rates: a. Water amounts less than 1000 gallons are charged at 0.05 per gallon. b. Water amounts between 1000 and 9999 gallons are charged at 0.15 per gallon. c. Water amounts above 9999 gallons and less than 99000 gallons are charged at .20 per gallon. d. Water amounts above 99000 gallons are charged at 1.00 per gallon. Output: Display a nicely formatted message that indicates the number of gallons used and the cost of the water. Output should display on the screen and be written to a text file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
