

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


In an enumerated data type, different constants may not have the same value. -ANSWER False
Which if the following are valid case statements in a switch - ANSWER case 1: If you need to write a do-while loop that will ask the user to enter a number between 2and 5 inclusive, and will keep asking until the user enters a correct number, what is the loop condition? - ANSWER (2 > number || number > 5) A function may return a boolean value? - ANSWER True Given the following code, what is the final value of i? int i,j;for (i = 0 ; i < 4 ; i ++) { For (j = 0; j < 3 ; j++_ if (i ==2)break; } } - ANSWER 4 A boolean expression may evaluate to more than 2 values - ANSWER False A break statement in a switch stops your program. - ANSWER False
What is wrong with the following for loop? for( int i=0; i < 10; i--) { cout << "Hello\n" } - ANSWER infinite loop Which of the following is not a good reason for choose a certain loop control? -ANSWER if the loop is in a function
it is illegal to make function calls inside a switch statement - ANSWER False if you want a loop to quit iterating if x < 10 and y > 3, what would be the proper loopcondition test? - ANSWER (x >=10 || y <=3)
When testing a program with a loop, which of the following tests should be done? -ANSWER A B C (one less then max, no iterations, the max number)
The break statement causes all loops to exit - ANSWER False What is not an advantage of an enum class of a standard enum? -less memory ANSWER Occupies
Which loop structures always execute at least once - ANSWER do-while loops All nested if-else statements can be converted into switch statements. -False ANSWER
All switch statements can be converted into nested if-else statements - ANSWER True A semicolon by its self is a valid C++ statement - ANSWER True