Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

9, A the for statement B the while statement c the statement D the switch statem

ID: 3581775 • Letter: 9

Question

9, A the for statement B the while statement c the statement D the switch statement which control statement which is best used when you know how many times to repeat the many The control statement used when you need to choose which statements to execute from amont choices, and the condition whichistest 11. for selection can be expressed as some expression isno The control statement which is best used when you want to tepeat a group of statements over and over based Use in body must be e ast onceis the? the following program SEGMENT to answer the next two questions for c4, J. A 12. How many times is the statement cout u

Explanation / Answer

9) for loop

10) switch statement

11) do/while loop

12) (C) 3

13) (A) 0

14) (B) False.(Because it while loop but not do-while loop)

15) (A) True

16) (B) False

17) (D) #include <fstream>

18) (A) ifstream MyInput("exam.txt");

19) (D) You open the file, and associate with a specific file name.

20) (A) AnsFile.open("myanswers.txt");

21) (A) AnsFile << value;

22) (A) MyInput >> value;

23) (C) AnsFile.close();

24) (C) while( ! DataFile.eof())

25) (C) must agree in number and order

26) (A) Function fun1 can modify the arguments passed to both Num1 and Num2.

27) (A) Cstdlib

28) (C) myNumber = rand();