In this exercise, you modify the Norbert Pool & Spa Depot application from Exercise 9. Use Windows

Question:

In this exercise, you modify the Norbert Pool & Spa Depot application from Exercise 9. Use Windows to make a copy of the Norbert Solution-Introductory folder. Rename the copy Norbert Solution-Intermediate. Open the Norbert Solution (Norbert Solution.sln) file contained in the Norbert Solution-Intermediate folder.

a. Add two labels to the form. Position one of the labels below the Gallons: label, and then change its Text property to Cost:. Position the other label below the lblGallons control, and then change its Name, TextAlign, AutoSize, and BorderStyle properties to lblCost, MiddleCenter, False, and FixedSingle, respectively. Remove the contents of its Text property, and then size the control appropriately. Also, change the control’s Font and BackColor properties to match the lblGallons control.

b. Add a method named GetVolume to the RectangularPool class. The method should calculate and return the volume of a RectangularPool object. The formula for calculating the volume is length * width * depth.

c. Add a method named GetGallons to the RectangularPool class. The method should receive a Double number that represents a RectangularPool object’s volume. It should use the information it receives to calculate and return the number of gallons of water.

d. Remove the GetGallons function from the form’s Code Editor window, and then modify the btnCalc_Click procedure to use the customerPool object’s GetVolume and GetGallons methods. The procedure should also calculate and display the cost of filling the pool with water. The charge for water is $1.75 per 1,000 gallons (or $0.00175 per gallon). Test the application appropriately.


Data From Exercise 9:

In this exercise, you modify the Norbert Pool & Spa Depot application from this lesson. Use Windows to make a copy of the Norbert Solution folder. Rename the copy Norbert Solution-Introductory. Open the Norbert Solution (Norbert Solution.sln) file contained in the Norbert Solution-Introductory folder. Modify the RectangularPool class so that it uses Private variables and Public Property procedures rather than Public variables. Include both a default constructor and a parameterized constructor in the class. Test the application appropriately.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: