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

True/False 3 Points each ( total points 30) 1. The escape sequence ‘\ ’ means ne

ID: 3674392 • Letter: T

Question

True/False 3 Points each ( total points 30) 1. The escape sequence ‘ ’ means newline. It causes the cursor to move to the beginning of the next line on the screen. 2. C++ programs begin executing at the function main ( ) , even if main does not appear first in the program. 3. The module operator % can be used both with integer and double numbers. 4. A selection control structure chooses among alternative courses of action. 5. A nested control statement appears in the body of another control statement. 6. The statements Salary = 5000.00 is same as Salary = = 5000.00. 7. The statement count = count + 1 is same as ++ count . 8. A structured program should be written using only the three control structures, sequence, selection and repetition. 9. The logical OR operator ( | | ) ensures that both conditions are true before choosing certain path for execution. 10. In C++ the return value of a true statement is 1 and the return value of a false statement is zero. Questions 11 to 15 worth 8 points each total 40 points 11 . What is the output of the following C++ loop? (8 Points) for ( int K =11 ; K >= 1 ; K = K + 2 ) cout << K << endl; 12. What is the output of the following loop? (8 points). int M = 1; while ( M < = 20 ) { if ( M % 5 = = 0 ) continue; else cout << M<

Explanation / Answer

1) TRUE.

" " causes the cursor to move to the beginning of the next line on the screen.

2) TRUE.

C++ programs begin executing at the function main ( ) , even if main does not appear first in the program.

3) FALSE.

% can only be used with integral variables.

4) TRUE.

A selection control structure chooses among alternative courses of action.

5) TRUE.

A nested control statement appears in the body of another control statement.

6) FALSE

The statement Salary = 5000.00 is an assignment statment where as Salary == 5000.00 is a conditional statement.

7) TRUE.

The statement count = count + 1 is same as ++ count .

8) TRUE.

A structured program should be written using only the three control structures, sequence, selection and repetition.

9) FALSE.

The logical OR operator ( | | ) ensures that either/both of the conditions to be true before choosing certain path for execution.

10) TRUE.

In C++ the return value of a true statement is 1 and the return value of a false statement is zero.

11) 11

9

7

5

3

1

12) Question not complete.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote