CIS 170B Week 3 Quiz

Published on January 2018 | Categories: Science | Downloads: 123 | Comments: 0 | Views: 762
of 1
Download PDF   Embed   Report

1. (TCO 5) When writing a program, if you know that statements in a loop must execute at least once, use the _____ structure. 2. (TCO 5) When used within a loop structure, the _____ statement causes execution to jump out of the loop and proceed with subsequent statements in the program 3. (TCO 5) The _____ looping structure tests its conditional expression before the statements it contains execute, whereas the _____ looping structure tests it afterward 4. (TCO 10) During a code walk-through, someone may suggest that this code be replaced with _____, as it is more efficient. int val = 0; while (val < 10) { Console.WriteLine(val); val++; 5. (TCO 5) A block of statements within the body of a WHILE loop must be surrounded with 6. (TCO 5) What output will this set of statements produce? int a = 1; while (a > 1) { Console.Write("{0}\t", a); a--; } Console.Write("{0}\t", a); 7. (TCO 5) In this code, the variable _____ is a counter and the variable _____ is an accumulator. double total = 0, weight = 2.0, limit =10, max = 50; int track = 0; for (int num = 0; num

Comments

Content

1. (TCO 5) When writing a program, if you know that statements in a loop must execute at least once, use the _____ structure. 2. (TCO 5) When used within a loop structure, the _____ statement causes execution to jump out of the loop and proceed with subsequent statements in the program 3. (TCO 5) The _____ looping structure tests its conditional expression before the statements it contains execute, whereas the _____ looping structure tests it afterward 4. (TCO 10) During a code walk-through, someone may suggest that this code be replaced with _____, as it is more efficient. int val = 0; while (val < 10) { Console.WriteLine(val); val++; 5. (TCO 5) A block of statements within the body of a WHILE loop must be surrounded with 6. (TCO 5) What output will this set of statements produce? int a = 1; while (a > 1) { Console.Write("{0}\t", a); a--; } Console.Write("{0}\t", a); 7. (TCO 5) In this code, the variable _____ is a counter and the variable _____ is an accumulator. double total = 0, weight = 2.0, limit =10, max = 50; int track = 0; for (int num = 0; num

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close