我試圖顯示總工作時間讓說40然後 允許輸入小時工資讓說35 ..最後 顯示1400這是總數..可以有人請舉手。Javascript顯示輸出計算
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>
assignment3</title> <script type= "text/javascript"> <!-- var name;
//string enterted by user
var input; //string enterted by user
var hours; //string enterted by user
var payRate; //string enterted by user
var grossPay; //string enterted by user
// read the name
name = window.prompt("What is your name?"); /*paranthesis missing and quotation marks misplaced */
input = window.prompt("Enter the hours you worked.");
hours = ParseInt();
input = window.prompt("Enter you hourly wage.");
payRate = ParseFloat();
grossPay = hours * payRate;
//result
document.writeln ("<h1> Hello" + name + " your gross pay is $" + grossPay+" <h1>");
//--> </script> </head> <body> </body> </html>
'ParseInt();'或'ParseFloat()'應該有參數。 – ASDFGerte
這個'hours = ParseInt();'應該做什麼? – j08691