Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- # Dictionary of paint colors and cost per gallon
- paintColors = {
- 'red': 35,
- 'blue': 25,
- 'green': 23
- }
- # FIXME (1): Prompt user to input wall's width
- # Calculate and output wall area
- wallHeight = float(input('Enter wall height (feet): n'))
- wallWidth = float(input('Enter wall width (feet): n'))
- wallArea = float((wallHeight) * (wallWidth))
- print('Wall area:', wallArea, 'square feet')
- # FIXME (2): Calculate and output the amount of paint in gallons needed to paint the wall
- paint_gallons = ((wallArea) / 350)
- print('Paint needed:', paint_gallons, 'gallons')
- # FIXME (3): Calculate and output the number of 1 gallon cans needed to paint the wall, rounded up to nearest integer
- paint_cans = math.ceil(paint_gallons)
- print('Cans needed:', paint_cans, 'can(s)n')
- # FIXME (4): Calculate and output the total cost of paint can needed depending on color
- wallColor = input('Choose a color to paint the wall: n')
- paint_colors = {
- 'red' : 35,
- 'blue' : 25,
- 'green' : 23
- }
- if wallColor in 'red':
- paint_cost = (paint_colors['red'] * (paint_cans))
- if wallColor in 'blue':
- paint_cost = (paint_colors['blue'] * (paint_cans))
- if wallColor in 'green':
- paint_cost = (paint_colors['green'] * (paint_cans))
- print('Cost of purchasing', wallColor, 'paint: $', paint_cost)
Add Comment
Please, Sign In to add comment