Clearly Visual Basic: Programming with Microsoft Visual Basic 2012 Pages 601-603
ID: 3847848 • Letter: C
Question
Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
Pages 601-603: Pool Supplies Application:
Ifollowed all the steps but I am facing error of “ GetGallons is not member of RectangularPool”, Can you please check with this.
Private Sub btnCalc Click sender As Object, e As EventArgs Handles btnCalc. Click calculates and displays the number of gallons in a pool and the number of ounces of clarifier needed Dim pool As New Rectangular Pool Dim Gallons As Double Dim dblounces As Double Double .Try ParseCtxtLength Text, pool. Length) Double. TryParse(txtWidth. Text, pool .Width) Double. Try Parse CtxtDepth .Text, pool .Depth) dblGallons pool GetGallons or db10unces dbl Gallons 5000 1blGallons Text dbl Gallons. ToString "NO") lbiclarifier. Text db10unces. ToString "N1") End SubExplanation / Answer
If the defintion of the class was provided then it would have been better, however I am assuming that RectangularPool is a class with some method as GetGallons. Now, in order to access a method outside of its class, you have to use the period operator followed by parentheses (). Your program here is missing the parenthesis. Let me know after inserting the parentheses, you get an error or not.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.