a. Draw a flowchart or write pseudocode to represent the logic of a program that
ID: 3557883 • Letter: A
Question
a. Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter values for the width and length of a wall in feet. The program outputs the area of the wall in square feet.
b. Modify the program that computes wall area to allow the user to enter the price of a gallon of paint. Assume that a gallon of paint covers 350 square feet of a wall. The program outputs the number of gallons needed and the cost of the job. (For this exercise, assume that you do not need to account for windows or doors, and that you can purchase partial gallons of paint.)
Explanation / Answer
a) pseudocode
double width,length,area
print "Enter width and heigth of wall"
read width
read height
area = width*height
print "area of wall :"area
b) pseudocode
double width,length,area,pricePerGallon,paintReqired,costOfJob
print "Enter width and heigth of wall"
read width
read height
print "Enter price of paint per gallon"
read pricePerGallon
area = width*height
paintReqired = area/350
costOfJob = paintReqired*pricePerGallon
print "total paint required in gallon:"paintReqired
print "cost of job :"costOfJob
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.