Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How to Calculate Your Water Bill Your water bill includes these charges: Minimum

ID: 3873462 • Letter: H

Question

How to Calculate Your Water Bill

Your water bill includes these charges:

Minimum Bill + Volume Charge = Total Water Bill

All customers pay the minimum bill, which includes up to 2 Ccf (1,496 gallons) of water. If you use more than 2 Ccf, you pay an additional volume charge. To determine your minimum bill and volume charge, you need to know three things:

Water used
This is on your bill in a unit called Ccf, which stands for hundred cubic feet. 1 Ccf equals 748 gallons. To convert Ccf to gallons, multiply by 748.

  Example: 6 Ccf x 748 = 4,488 gallons

Water connection size
Find it on your bill. Residential customers typically have a 3/4 inch connection. Larger connections place a greater demand on the system.

Whether you live inside or outside the City of Charleston
This affects your minimum bill and volume charge.


Water rates

EXAMPLE In this homework, you will code an application for water bill calculation. The application calculates a customer's water bill. You are to calculate and display the gallons of water used and the water charge for a water bill. • Allow the user to only enter in numbers and the backspace key in the xCurrentTextBox and xPreviousTextBox controls. • The charge for water is $1.75 per 1000 gallons, or $ .00175 per gallon. • Before calculating, make sure the meter readings are valid. This means that the current reading is greater than or equal to the previous reading. • If the data is valid, calculate the gallons of water used and the charge. • Display the gallons used and the charge. The charge should be in displayed in currency and centered in the label. • If the data is not valid then display a message box that has an OK button and the Exclamation icon. The message should tell the user that the data was invalid - current must be greater than previous. • Clear the contents of the xGallonsLabel and xChargeLabel controls when a change is made to the contents of a text box on the form. • Select the text when the user enters either textbox after calculating . Use the Enter procedure. Test with 2 pieces of test data. Current: 14350 Current: 3571 Previous: 12232 Previous: 5470 Possible Variables: Const GallonCharge As Double = 0.00175 Const Message As String = "The current reading must be greater than or equal to the previous reading." Dim current As Integer Dim previous As Integer Dim gallonsUsed As Integer Dim totalCharge As Double Pseudocode for Calculate: If Current > = Previous then Calculate gallons used Calculate amount due Display amount and gallons (centered in label & format as currency) Else Msgbox invalid data (Title and Prompt, OK button, ! icon) End if TEST DATA #1 EXAMPLE OF ERROR MESSAGE: Points distribution: 1. [5 points] Write the algorithm. 2. [5 points] Create a flowchart 3. [5 points] Design the form 4. [5 points] Program for buttons 5. [5 points] Calculate the bill

If you can do this in Visual Basic contact me = +9965663360736

Explanation / Answer

#include<iostream>

using namespace std;

int main()

{

float XcurrentTextBox;XpreviousTextBox;

float minimum_charge

String conection_type;

String city;

cout<<"XcurrentTextbox = ";

cin>>XcurrentTextbox;

cout<<"XpreviousTextBox = ";

cin>>XpreviousTextBox;

cout<<"conection_type = ";

cin>>conection_type;

cout<<"city = ";

cin>> city;

  

if(XcurrentTextBox>XpreviousTextBox)

{

volume = (xcurrentTextBox-XpreviousTextBox)*748

cout<<"total gallon water used = "<<volume;

if(volume>1496 && city == "Charleston" && conection_type == 3/4 inch)

{

volume = volume - 1496;

total bill = volume*0.00175 +minimum_charge;

}

else

total bill = minimum_charge;

cout<<" total bill = $"<<total bill;

}

else

cout<<"Invalid data";

}

algorithm and flowchart:-

input xcurrenttextbox

input xprevioustextbox

input city name

input connection type

define minimum_charge(as it remain constant- not given in the question description)

if(XcurrentTextBox>XpreviousTextBox)

calculate volume of water in gallon used

then check city and connection type if they are true

calculate bill

volume =volume-minimum gallon

remaining volume*per gallon cost+minimun_charge = total bill

display bill

else

show in valid data;

//code in c++

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote