var member1 = prompt("Bowler's Name", "Name");
var member1score1 = prompt("Score from game 1", "");
var member1score2 = prompt("Score from game 2", "");
var member1score3 = prompt("Score from game 3", "");
var memeber1avg = ((memberscore1 + member1score2 + member1score3)/3);
var member2 = prompt("Bowler's Name", "Name");
var member2score1 = prompt("Score from game 1", "");
var member2score2 = prompt("Score from game 2", "");
var member2score3 = prompt("Score from game 3", "");
var memeber2avg = ((memberscore1 + member1score2 + member1score3)/3);
var member3 = prompt("Bowler's Name", "Name");
var member3score1 = prompt("Score from game 1", "");
var member3score2 = prompt("Score from game 2", "");
var member3score3 = prompt("Score from game 3", "");
var memeber3avg = ((memberscore1 + member1score2 + member1score3)/3);
var member4 = prompt("Bowler's Name", "Name");
var member4score1 = prompt("Score from game 1", "");
var member4score2 = prompt("Score from game 2", "");
var member4score3 = prompt("Score from game 3", "");
var memeber4avg = ((memberscore1 + member1score2 + member1score3)/3);
好吧,所以我是js的新手,我知道這可以做到更簡單的方法與數組...只是不知道如何。另外我該如何寫這個表格?輸出一個名稱和平均分數的表
*死亡*想到的。或者至少是一次致殘。 –
哈哈耶我知道...幫助? –
有很多重複的代碼。您可能想要考慮如何編寫單個函數來計算單個成員的平均值。然後調用該函數3次。 –