sweety53216
asked on
Calculates and display gallons of water used and total charged
Code an application so that it calculates and displays the number of gallons of water used and the total charge for water. the charge for the water is $1.75 per 1000 gallons or .00175 per gallon. Make the calculations only when the current meter reading is greater than or equal to the previous meter reading; other wise diplay an approiate message.Displya total charge with a dollar sign and two decimals. the text boxes should only accept numbers and th backspace key.Clear number of gallons used and the total charge when a change is made to contents. when a text box receives focus, select its exsisiting text.
I have attached the zip file of what I have so far
Allenton-Solution.sln
I have attached the zip file of what I have so far
Allenton-Solution.sln
your attached file is not showing any code... you posted solution file by mistake instead of code file...
ASKER
ublic Class Form1
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
This is what I have so far
End Sub
Private Sub bntCalc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bntCalc.Click
'calculates total gallons and total charge
lbltotalgallons.Text = Val(TxtCurrent.Text) - Val(Txtprevious.Text)
lbltotalcharge.Text = Val(lbltotalgallons.Text) * 0.00175
lbltotalcharge.Text = Format(lbltotalcharge.Text , "currency")
Private Sub TextBox5_TextChanged(ByVal
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
This is what I have so far
End Sub
Private Sub bntCalc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bntCalc.Click
'calculates total gallons and total charge
lbltotalgallons.Text = Val(TxtCurrent.Text) - Val(Txtprevious.Text)
lbltotalcharge.Text = Val(lbltotalgallons.Text) * 0.00175
lbltotalcharge.Text = Format(lbltotalcharge.Text
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.