- Guías de estudio, Notas de estudios & Resúmenes
¿Buscas las mejores guías de estudio, notas de estudio y resúmenes para ? En esta página encontrarás 8 documentos de estudio para .
8 resultados
Examen
AP Computer Science - Iteration (Unit 4) Test Review Questions And All Correct Answers.
repeat statements in our programs - Answer What do loops allow us to do? 
 
while loops and for loops - Answer What are the two main types of loops? 
 
when the condition being checked is true - Answer In loops, when does the statement inside the loop execute? 
 
-initial conditions (where we start) 
-statements (what we're going to do each time) 
-terminating conditions (usually something that increments inside the loop, and this helps the loop to stop) - Answer What are the thre...
Examen
Ap Comp - Sci A - Unit 4 Review Questions And All Correct Answers.
PopularWhich statement can we use inside of a loop to end it? 
 
- Sln; 
- break; 
- SENTINEL; 
- else; - Answer break 
 
Which statement could be added to the while loop below so that it doesn't run indefinitely? 
public static void main(String[] args) 
 { 
int x = 7; while (x > 0) 
{ 
 Sln(x); 
} 
} 
 
- You can add x-- after the print statement. 
- You can add x = -1 after the print statement. 
- You can add x++ after the print statement. 
- Both A and B above. - Answer Both A and B ...
Examen
Computer Science Tests + Quizzes With Guaranteed Pass Solutions.
setting a starting value for a variable is called - Answer initializing 
 
which of the following is NOT true about while loops 
a. used to find remainders 
b. use conditions like if statements 
c. a way of repeating a code 
d. give us more control over how the program runs - Answer a` 
 
loops are used to _____________ code - Answer repeat 
 
why do we use WHILE loops? 
a. because of efficiency 
b. because computers can do calculations humans can't 
c. because programs need to ma...
Examen
D278 4.11 Loops summary Prep Exam Questions And Correct Answers.
What is a loop in programming? - Answer A program construct that repeatedly executes the loop's statements (known as the loop body) while the loop's expression is true; when false, execution proceeds past the loop. 
 
What is each time through a loop's statements called? - Answer An iteration. 
 
What is a common task for loops in programming? - Answer To examine a list of values one value at a time and update variables along the way, such as computing an average, counting the ...
Examen
Comp Sci loops Study Guide Exam Questions And Actual Answers.
How many lines will this program print? 
 
while True: 
 print "hi" 
 
0 
 
 
1 
 
 
an infinite number of lines - Answer an infinite number of lines 
 
How many lines will this program print? 
 
x = 10 
while x > 0: 
 print x 
 x = x - 3 
 
3 
 
 
4
Examen
Chapter 4 Computer Science Latest Exam Questions And Answers Rated A+.
We use loops to: 
 Process Numeric Data 
 Ask true/false questions 
 Repeat blocks of code 
 Ask users to enter information - Answer Repeat blocks of code 
 
Consider the following code: 
 
num = int(input("Enter a number, negative to stop")) 
 
while (num >= 0): 
 print ("You entered: " + str(num)) 
 
num = int(input("Enter a number, negative to stop")) 
print ("Done.") 
What is wrong? 
 
 The num >= 0 test condition is not correct 
 There is nothing wrong wi...
Examen
AP-Computer Science – Loops Midterm Exam Questions And Actual Answers.
If...Then loop - Answer Which of these is not a loop? 
A. For loop 
B. If...Then loop 
C. While loop 
D. Do...While loop 
 
640 - Answer Examine the following code: 
 int count = 10; 
 for(int x = 0; x<=5; x++){ 
 count = count*2; 
 } 
 Sln(count); 
What will be printed as a result of executing this code? 
A. 60 
B. 210 
C. 640 
D. 1000 
E. There will be a compilation error. 
 
Infinite loop - Answer What error will occur when the following Do...While Loop is executed. 
 int count = ...
Examen
AP CSP - Lists, Loops, and Traversals Questions And Actual Answers.
List - Answer an ordered collection of elements 
 
Element - Answer an individual value in a list that is assigned a unique index 
 
Index - Answer a common method for referencing the elements in a list or string using numbers 
 
Iteration - Answer a repetitive portion of an algorithm which repeats a specified number of times or until a given condition is met. 
 
infinite loop - Answer occurs when the ending condition will never evaluate to true. 
 
Traversal - Answer the proce...