D8_判斷式


Posted by Christy on 2021-04-25

練習一:

請你自己寫出一段程式碼,是判斷一個叫做 score 的變數是否及格(超過或剛好 60 分),如果及格的話就輸出 pass,否則輸出 fail。

進階練習:

除了判斷是否及格以外,也請你對滿分做出特別判斷,如果是 100 分的話就輸出 you are no1!

var score = 10
if (score >=60 && score <=99) {
    console.log ('pass')
} else if (score <60) {
    console.log ('fail')
} else {
    console.log ('you are no1!')
}









Related Posts

Cacti Data Sources (RRA)

Cacti Data Sources (RRA)

教你朋友 CLI(command line)

教你朋友 CLI(command line)

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段四:個人專案~Sprint 4)

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段四:個人專案~Sprint 4)


Comments