(c) Refer to the output console of C++ Program in Figure Q1(c), OUTPUT CONSOLE Class Performance Calculator I Please insert number of students: 5 [Enter] Please insert Student 1's mark: 10 [Enter]...


(c) Refer to the output console of C++ Program in Figure Q1(c),<br>OUTPUT CONSOLE<br>Class Performance Calculator I<br>Please insert number of students: 5 [Enter]<br>Please insert Student 1's mark: 10 [Enter]<br>Please insert Student 2's mark: 100 [Enter]<br>Please insert Student 3's mark: 0 [Enter]<br>Please insert Student 4's mark: 70 [Enter]<br>Please insert Student 5's mark: 70 [Enter]<br>The class performance is as follows:<br>The highest mark is 100.<br>1)<br>2)<br>The lowest mark is o.<br>Figure Q1(c): C+ program output console<br>(i) Identify whether the program in Figure Ql(c) is a counter-controlled repetition or<br>sentinel-controlled repetition.<br>(1i) Write the complete program to produce output as the shown in Figure Ql(c).<br>Note: The words in bold is the input/testing case given by user. Used do-while-loop<br>for repetition and one-way if selection in your algorithm.<br>

Extracted text: (c) Refer to the output console of C++ Program in Figure Q1(c), OUTPUT CONSOLE Class Performance Calculator I Please insert number of students: 5 [Enter] Please insert Student 1's mark: 10 [Enter] Please insert Student 2's mark: 100 [Enter] Please insert Student 3's mark: 0 [Enter] Please insert Student 4's mark: 70 [Enter] Please insert Student 5's mark: 70 [Enter] The class performance is as follows: The highest mark is 100. 1) 2) The lowest mark is o. Figure Q1(c): C+ program output console (i) Identify whether the program in Figure Ql(c) is a counter-controlled repetition or sentinel-controlled repetition. (1i) Write the complete program to produce output as the shown in Figure Ql(c). Note: The words in bold is the input/testing case given by user. Used do-while-loop for repetition and one-way if selection in your algorithm.
(a) Write a general syntax for one-way selection.<br>(b) Convert the C++ program in Figure Q1(b) to the switch-case statement.<br>SOURCE CODE<br>#include <iostream><br>using namespace std;<br>int main ()<br>int C, y;<br>cin >> C;<br>if (C 1 || C 2)<br>y=10;<br>else if (C ==<br>3 || C == 4)<br>y=20;<br>else<br>y=30;<br>return 0;<br>Figure Q1(b): C++ Program<br>

Extracted text: (a) Write a general syntax for one-way selection. (b) Convert the C++ program in Figure Q1(b) to the switch-case statement. SOURCE CODE #include using namespace std; int main () int C, y; cin >> C; if (C 1 || C 2) y=10; else if (C == 3 || C == 4) y=20; else y=30; return 0; Figure Q1(b): C++ Program

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here