Home / Expert Answers / Computer Science / a-explain-the-difference-between-repetition-control-structure-and-selection-control-structure-2-pa180

(Solved): a. Explain the difference between repetition control structure and selection control structure. (2 ...





a. Explain the difference between repetition control structure and selection control structure.
(2 marks)
b. Based on the C++
Line 1
Line 2
Line 3
Line 4
statement.
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
Line 11
double sales
char code 1
cout << S
a. Explain the difference between repetition control structure and selection control structure. (2 marks) b. Based on the C++ code segment in Figure 1, modify the if statement on Lines 7 through 10 to use the != operator in the condition? Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 double sales = 0.0, rate= 0.0; char code cout << "Sales: "; cin >> sales; cout << "Code (1, 2, 3, or = 4): "; cin >> code; if (code = '1' || code '3') else rate = 0.2; B Line 1 Line 2 Line 3 Line 4 statement. Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Line 11 double sales char code 1 cout << "Sales: "; cin >> sales; cout << "Code (1, 2, 3, or 4) : "; cin >> code; if (code '3') else sales H rate = = = '; = rate 1 0.0, rate E '1' II code == 0.2; 0.0; 0.15; sales + (sales* rate); Figure 1 (3 marks) c. Based on the C++ code segment in Figure 1, modify Lines 7 through 10 to use switch/case (5 marks)


We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe