Answer to Question #295456 in Visual Basic for Brenda

Question #295456

Lab6: Canton Water Department

Lab6 requires you to create the following: 

  • Exercise 25 - Canton Water Department (p. 225)
  • An example form is provided below
  • Make sure to include Pseudocode or Flowchart for all code Events
  • Include this file in submitted lab folder

Your lab needs to include the following: 

  • Use proper variable types, names, and naming conventions
  • Use proper control (buttons, labels, etc.) names and naming conventions
  • Use the three option statements found in figure 3-23 (p. 136)
  • Do not leave any blank blocks of code or events
  • Use proper access keys and appropriate tab order
  • Include a default button when appropriate
  • Lock form controls
  • Include documentation comments on the main form code, as well as code comments for each major line of code
  • Add the solution folders to a created folder with the following naming convention: CourseNumber_LastNameFirstInitial_LabXX
  • Folders should be compressed

 

I will send the rest in another question 




1
Expert's answer
2022-02-09T08:51:13-0500
Start
	Declare variable previousMeterReading As Double
        Input previousMeterReading 
        Declare variable currentMeterReading As Double  
        Input currentMeterReading 
        Declare variable gallonsWaterUsed As Double
        Set gallonsWaterUsed=currentMeterReading - previousMeterReading
        Declare variable totalChargeWater As Double 
        Set totalChargeWater=19.5 + 0.00175 * gallonsWaterUsed
        Display gallonsWaterUsed
        Display totalChargeWater
Stop



Form





Code:

Public Class Form1


  Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click

    Dim previousMeterReading As Double = Double.Parse(txtPreviousMeterReading.Text)

    Dim currentMeterReading As Double = Double.Parse(txtCurrentMeterReading.Text)

    Dim gallonsWaterUsed As Double = currentMeterReading - previousMeterReading

    Dim totalChargeWater As Double = 19.5 + 0.00175 * gallonsWaterUsed

    txtGallonsWaterUsed.Text = gallonsWaterUsed.ToString("N")

    txtTotalChargeWater.Text = totalChargeWater.ToString("C")

  End Sub

End Class



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS