FC0-U61 · Question #31
FC0-U61 Question #31: Real Exam Question with Answer & Explanation
The correct answer is D: Pancakes. The output of the Breakfast program if it ran on Sunday would be pancakes. The program uses an if- else-if-else statement to choose among different breakfast options based on the day of the week input. The program first checks if the day input is equal to "Saturday". If this cond
Question
Exhibit
Options
- AOatmeal
- BBacon and eggs
- CWaffles
- DPancakes
Explanation
The output of the Breakfast program if it ran on Sunday would be pancakes. The program uses an if- else-if-else statement to choose among different breakfast options based on the day of the week input. The program first checks if the day input is equal to "Saturday". If this condition is true, it prints "Waffles" and ends. If this condition is false, it checks if the day input is equal to "Sunday". If this condition is true, it prints "Pancakes" and ends. If this condition is false, it prints "Oatmeal" and ends. Since the day input is "Sunday", the second condition is true, and the program prints "Pancakes".
Community Discussion
No community discussion yet for this question.
