Now You Code In-Class: Boxes Of Flooring

High's Home Improvement has hired you to write a mobile app which will estimate the number of boxes of laminate flooring required to cover a room.

Things to note:

  • One box of flooring covers 24.5 square feet.
  • You should account for 10% waste in any project. This means you should by 10% more flooring than you need.

Write a python program which given the length and width measurement of a room will correctly calculate:

  • The area of the room in square feet
  • The project area when accounting for 10% waste
  • The number of boxes of flooring required, rounded up to the nearest whole box.

Example:

*** Boxes of Flooring ***
Length of room (ft): 3
Width of room (ft): 6

Calculations....
Room Area: ==> 18.0 square ft
Project Area: 18.0 square ft + 1.8 (10% waste) ==> 19.8 square ft
Number of boxes at 24.5 square ft: ==> 1

NOTE: Use string formatters or f-strings to display the output to 1 decimal place.

HINT: Use the math.ceil() function to round up your number of gallons to the nearest whole number. You cannot sell fractional cans of paint!

Step 1: Problem Analysis

Inputs:

Outputs:

Algorithm (Steps in Program):


In [1]:
import math
# Step 2: Write code here