Hey
Dean here again, I've been assigned to make an earnings calculator with user input I'm just having trouble in making the final sum work I just get NaN for an answer
function getValue() {
var values = new Array(239.99, 129.75, 99.95, 350.89);
var name = prompt("Enter your name: ","name here");
var quan1 = prompt("How many of item 1 were sold : ","Quanity sold");
var quan2 = prompt("How many of item 2 were sold : ","Quanity sold");
var quan3 = prompt("How many of item 3 were sold : ","Quanity sold");
var quan4 = prompt("How many of item 4 were sold : ","Quanity sold");
var com1 = alert("Your commission on item 1 is : " + Math.round(((values[0] * quan1) * 0.09) * 100) / 100);
var com2 = alert("Your commission on item 2 is : " + Math.round(((values[1] * quan2) * 0.09) * 100) / 100);
var com3 = alert("Your commission on item 3 is : " + Math.round(((values[2] * quan3) * 0.09) * 100) / 100);
var com4 = alert("Your commission on item 4 is : " + Math.round(((values[3] * quan4) * 0.09) * 100) / 100);
alert("Total earnings for the week for: " + name + (parseFloat(com1) + parseFloat(com2) + parseFloat(com3) + parseFloat(com4) + 200) );
}
Any help will be appreciated
Thanks
Dean