room

by Ryan Kleinhans

JavaScript

var length
var width
var price
var squareFeet
var total

length = parseFloat (prompt("What is the length in feet of your room?"))
width = parseFloat (prompt("What is the width in feet of your room?"))
price = parseFloat (prompt("What is the price of your carpet?"))

squareFeet = length * width

total = price * squareFeet

alert("Your room is " + squareFeet + " square feet. The total cost of the carpeting for your room will be $" + total.toFixed(2))