← Projects

Find Cost of Tile to Cover W x H Floor done

9f283098357d8defa5c606686d32068126c640a0 · Karan Goel · Jul 5, 2013 21:42

+11 · 1 file changed

  • Numbers/tile.py +11 −0
diff --git a/Numbers/tile.py b/Numbers/tile.py
new file mode 100644
index 0000000..6f4d7cf
--- /dev/null
+++ b/Numbers/tile.py
@@ -0,0 +1,11 @@
+# Find Cost of Tile to Cover W x H Floor - Calculate
+# the total cost of tile it would take to cover a floor
+# plan of width and height, using a cost entered by the user.
+
+# Use input as the input can be integer and float
+cost = input("What's the cost per sq. feet? ")
+width = input("What's the width of the floor? ")
+height = input("What's the height of the floor? ")
+
+print "The total cost is $%.2f for %.2f square feet" \
+      % (width * height * cost, width * height)