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

I see a couple solutions for other languages except Visual Basic. A painting com

ID: 675324 • Letter: I

Question

I see a couple solutions for other languages except Visual Basic.

A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor are required. The company charges $18.00 per hour for labor. Create an application that allows the user to enter the number of rooms to be painted and the price of the paint per gallon. The application should use input boxes to ask the user for the square feet of wall space in each room. It should then display the following information:

• The number of gallons of paint required

• The hours of labor required

• The cost of the paint

• The labor charges

• The total cost of the paint job

Input validation: Do not accept a value less than 1 for the number of rooms. Do not accept a value less than $10.00 for the price of paint. Do not accept a negative value for square footage of wall space.

Explanation / Answer

Module Module1

Sub Main()
Dim rm As Integer = 0
Dim totc, lbrc, cost, gal, pr, sqf, labh As Double
pr = 0

sqf = -1
While (rm < 1)
rm = Val(InputBox("Enter Number of rooms to be Painted"))
End While
While (pr < 10)
pr = Convert.ToDouble(InputBox("Enter the Price of Paint per Gallon"))
End While
While (sqf < 0)
sqf = Convert.ToDouble(InputBox("Enter the Square feet of Wall space in each room"))
End While

gal = rm * sqf / 115

labh = gal * 8

cost = gal * pr

lbrc = labh * 18

totc = cost + lbrc

MsgBox("The number of gallons of paint required " & gal)
MsgBox("The hours of labor required " & labh)
MsgBox("The cost of the paint " & cost)
MsgBox("The labor charges " & lbrc)
MsgBox("The total cost of the paint job " & totc)


End Sub

End Module