Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CS 159 Exam 2 with Questions and Answers, Exams of Computer Science

CS 159 Exam 2 with Questions and Answers An infinite loop is a logical error ANSWER True The only way to stop a program caught in an infinite loop is to shut down your terminal software ANSWER False A nested loop is a repetitive process contained inside of another repetitive process ANSWER True One approach to potentially make solving problems that require nested loops easier is to separate each repetitive process into its own function ANSWER True According to the course standards a for loop should only be used with counter-controlled processes ANSWER True According to the course standards if all three expressions are not needed in a for loop then you should instead make use of a while loop for your pretest looping needs ANSWER True All while loops can be converted into for loops that abide by course standards ANSWER False You can make of x++, x+=1, and x =x+1, interchangeably as the update (third) expression for a for loop to increment the loop control variable ANSWER True

Typology: Exams

2024/2025

Available from 01/02/2025

school-inspector
school-inspector 🇺🇸

2

(1)

4.5K documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download CS 159 Exam 2 with Questions and Answers and more Exams Computer Science in PDF only on Docsity!

An infinite loop is a logical error ANSWER Truc The only way to stop a program caught in an infinite loop is to shut down your terminal software ANSWER False A nested loop is a repelitive process contained inside of another repetitive process ANSWER True One approach to potentially make solving problems thal require nested loops easier is to separate each repetitive process into its own function ANSWER True According to the course standards a for loop should only be used with counter-controlled processes ANSWER True According to the course standards if all three expressions are not needed in a for loop then you should instead make use of a while loop for your pretest looping needs ANSWER True All while loops can be converted into for loops that abide by course standards ANSWER False You can make of x1}, x!=1, and x =x! 1, interchangeably as the update (third) expression for a for loop to increment the loop control variable ANSWER Truc