Quiz 1 Recap

Multiple Choice Questions

 

  1. Function parameters

  2. Abstraction

  3. Top-down design

  4. Pseudo code with functions

  5. Debugging

  6. Iterative change

  7. Predicting code output

1. Function parameters


don't have to be numbers



2. Abstraction

a simplified representation of something more complex; allows you to hide details to help you manage complexity

 

Functions are a form of abstraction

 

 

3. Top-down Design

relies upon identifying sub-problems of a larger problem

 

also known as decomposition

 

4. Pseudocode

 

Max (a, b)

is a made up function that returns the greater of TWO values.

 

How would you use this function to find the greatest of THREE values?

 

Max (Max (a, b), c)

5. Debugging

The program doesn't know what size is, because it hasn't been defined as part of a function.

We can turn this into a function with a size parameter, OR

replace size with actual numbers

6. Iterative change

 

An iterative change (process) is based on figuring out how to make the code better, have more functionality, or be more organized. It doesn't change the overall design of a program.

 

  • Writing a sequence of commands to draw a fish, and then turning it into a function (more functionality)
  • Finding a better way to draw a fish (make the code better)
  • Moving function calls to the top (be more organized)
  • Removing unnecessary code

7. Predicting output

Draw it out. Use 180 degrees (a straight line) and 90 degrees as reference points for drawing out the angles

Made with Slides.com