Midterm #2Review Questions
Use as review anything from the self-check exercises, review questions, and end-of section programming exercises in Chapter 2.
What are the four steps in Problem Solving?
What four things may be needed to properly construct a Loop in an algorithm?
Do all Loops have an Increment or Decrement?
Do all Loops have a terminating condition?
What is the relationship between a terminating condition and the condition used in programming a WHILE or FOR loop?
What is the difference between a WHILE and DO/WHILE loop?
Define: Variable, Iterate, Increment, Decrement, Termination condition
Turn these terminating conditions into control expressions suitable for a WHILE loop by inverting them: a < 10, b == 5, c != 3, d <= 9
What does "echo the input" mean?
Write a C program that prints all the numbers between 1 and 1000.
Write a C program that prints the sum of all the even numbers between 20 and 20,000.
Write an algorithm that starts a counter at 100 and goes up by 3s, adding each number generated into a sum, until the sum is larger than 10,000. Print the last number added and the resulting sum.
Write an algorithm that gets a start integer and and end integer from the user and prints the square of all the numbers starting at the start value and going up to the end value.