题目
CSE-110-OD24-7345 5.1 Lesson and Knowledge Check - Study Hall Video Episodes 7-8
单项选择题
Which of the following is the correct code to perform the following tasks? ⦁ Print "The student has passed." if the integer variable finalMarks is greater than or equal to 50 ⦁ Print "The student has failed" if the variable finalMarks is less than 50
查看解析
标准答案
Please login to view
思路分析
Examining the task, we need a conditional that prints a passed message when finalMarks is at least 50, and a failed message otherwise.
Option being considered: if (finalMarks >= 50) {
System.out.println("The student has passed.");
}
else {
System.out.println("The student has failed.");
}
This stru......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
What is the output of the following code snippet if the cost contains 100: if cost > 150 : discount = 0.8 * costelse : discount = costprint("Your cost is:", discount)
The example program in the video has three possible outcomes depending on the following levels of radiation exposure: . Less than 0.5 sieverts . Greater than or equal to 0.5 but less than 4 sieverts . Greater than or equal 4 sieverts Which statement is used to capture an exposure value greater than or equal to 0.5 but less than 4 sieverts?
In a two-way if-else statement, when is the else block executed?
What is the purpose of the following code snippet?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!