Control Structures Quiz

  1. What are control structures? List two types of control structures and explain what they do. Give an example for each structure.
  2. What is lexical scoping and why is it important?
  3. What does it mean to 'mask' a variable inside of a nested block?
  4. Explain the difference between a loop and a conditional.
  5. What is an infinite loop? What strategies can help us prevent infinite loops?
  6. What is a breakpoint and what are they used for?
  7. Give an example of repeat times, while, and until.
  8. Give an example of an if statement.
  9. Describe a situation where a conditional statement would be useful.
  10. Describe a situation where a loop would be useful.
  11. What are libraries and how do they relate to use statements?
  12. Use the Quorum website's reference page to find the use statements for the following classes: 1) Drawable, 2) Microphone, and 3) File.
  13. Describe the concept of a package.
  14. Describe the concept of a nested loop and give an example in code.
  15. Describe how the concept of a conditional statement could be used for a program like a game (audio, visual, or multimedia) or robot?

Essay Questions

  1. Think about the common errors you have personally while using control structures. Write a short essay describing these errors. Do you personally have compiler errors? Runtime errors? Which has been more challenging to solve in your own programs?
  2. Write a short essay describing how the debugger can be used to find errors in control structures. In your essay, include the following concepts: 1) the error window, 2) breakpoints, and 3) step over.