Please do not copy and paste this python code again. The output is wrong.
import math
def computeWindowsDoorsArea():
print("How many windows and doors does the room contain?")
w_d = int(input())
total = 0
for i in range(w_d):
print(f"Enter the length of window/door {i+1} in feet.")
val = int(input())
print(f"Enter the width of window/door {i+1} in feet.")
total += val*int(input())
return total
def computeRectangleWallsArea():
print("Enter the length of the room in feet")
l = int(input())
print("Enter the widht of the room in feet")
w = int(input())
print("Enter the height of the room in feet")
h = int(input())
return 2 * \
calculateRectangleArea(
l, h) + 2 * calculateRectangleArea(w, h) - computeWindowsDoorsArea()
def calculateRectangleArea(l, h):
return l*h
def computeSquareWallsArea():
print("Enter the length of one side of the room in feet.")
val = int(input())
return computeSquareArea(val)-computeWindowsDoorsArea()
def computeSquareArea(val):
return val*val
def computeCustomWallsArea():
print("How many walls are in this room?")
walls = int(input())
total = 0
for i in range(walls):
print(f"Enter the height of wall {i+1} in feet.")
val = int(input())
print(f"Enter the length of wall {i+1} in feet.")
total += val*int(input())
return total - computeWindowsDoorsArea()
def computeGallons(total_area):
return math.ceil(total_area/400)
def computePaintPrice(total_area):
return computeGallons(total_area)*30*1.3
def computerRoomArea(roomNumber):
total_area = 0
for i in range(roomNumber):
print(f"Room {i+1}")
print('''Select the shape of the room:
1 – Rectangular
2 – Square
3 – Custom (more or less than four walls. All walls square or rectangular)''')
val = int(input())
if val == 1:
area = computeRectangleWallsArea()
print(f"For Room {i+1}, the area to be painted is {area} ft2 and will require {computeGallons(area)} gallons of paint. This will cost the customer ${computePaintPrice(area)}")
total_area += area
elif val == 2:
area = computeSquareWallsArea()
print(f"For Room {i+1}, the area to be painted is {area} ft2 and will require {computeGallons(area)} gallons of paint. This will cost the customer ${computePaintPrice(area)}")
total_area += area
elif val == 3:
area = computeCustomWallsArea()
print(f"For Room {i+1}, the area to be painted is {area} ft2 and will require {computeGallons(area)} gallons of paint. This will cost the customer ${computePaintPrice(area)}")
total_area += area
else:
print("Invalid Input")
print(f"The total area to be painted is {total_area} feet and will require {computeGallons(total_area)} gallons of paint. This will cost the customer ${computePaintPrice(total_area)}.")
print("Welcome to Shiny Painting for indoor painting!")
print("How many rooms do you want to paint?")
rooms = int(input())
computerRoomArea(rooms)