# -*- coding: utf-8 -*- """ When main() is run, it should run the paint_calculator. Other things to do: Get user_input instead of using the generic 4,5,3 room. Ask the user whether they want to paint another room. Check for proper values. (Mr Chuang will probably talk about this) """ def get_valid_input(input_text): user_input = "" while(True): try: user_input = int(input(input_text)) if(user_input<=0): print("Enter a larger number!") else: break except: print("Enter valid number") # assume it works return user_input def main(): length = get_valid_input("Enter the length\n") width = get_valid_input("Enter the width\n") height = get_valid_input("Enter the height\n") paint_calc(length,width,height) def paint_calc(length, width, height): """ This functions has 3 inputs, length, width and height It uses the math from assignment 1 to do this. It just prints out the result and does not return anything. """ area = 2*length*height + 2*width*height paint_needed = area/25 # YOUR CODE HERE print("Area needed to paint is: " + str(area)) print("Paint needed is: " + str(paint_needed))