W
Wayfarer
Can anyone please tell me how I can get this to work? Yes, it's
homework, but I just don't know how to take it any farther. It
won't show the total.
TIA
Neill
--
var L = prompt("Enter the length of carpet");
var W = prompt("Enter the width of carpet");
var C = prompt("Enter the cost per unit");
function carpet_cost(L,W,C)
{
var area = L * W;
var carpet_cost=(area * C);
}
return carpet_cost
window.alert ("The total cost of the carpet is", carpet_cost);
homework, but I just don't know how to take it any farther. It
won't show the total.
TIA
Neill
--
var L = prompt("Enter the length of carpet");
var W = prompt("Enter the width of carpet");
var C = prompt("Enter the cost per unit");
function carpet_cost(L,W,C)
{
var area = L * W;
var carpet_cost=(area * C);
}
return carpet_cost
window.alert ("The total cost of the carpet is", carpet_cost);