Answer:
program PaintCalculator
// Declare variables
height : real
length : real
area : real
gallons : integer
cost : real
answer : char
// Declare constants
SQ_FT_PER_GALLON : integer = 422
PRICE_PER_GALLON : real = 29.85
repeat
// Prompt for input
output "Enter the height of the fence in feet: "
input height
output "Enter the length of the fence in feet: "
input length
// Calculate area and gallons needed
area <- height * length
gallons <- area / SQ_FT_PER_GALLON
if area % SQ_FT_PER_GALLON > 0 then
gallons <- gallons + 1
end if
// Calculate cost
cost <- gallons * PRICE_PER_GALLON
// Output results
output "Total square feet to be painted: " + area
output "Gallons of paint needed: " + gallons
output "Total cost of paint: $" + cost
// Ask if user wants to continue
output "Do you want to make another estimate? (Y/N)"
input answer
until answer = 'N'
end program