How to Design Programs Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How to Design Programs

A good program comes with a short write-up that explains (4 things):

A

A short write-up that explains:

  • what it does
  • what inputs it expects
  • what it produces
  • assurance that it actually works
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to Design Programs

Recipe for designing a function (5 steps):

A

In the comments:

  1. Express intention for representing information as data
  2. Write down a signature, a purpose statement, and a function header
  3. Illustrate the signature and purpose with functional examples

Then:

  1. Stub the body of the function
  2. Write and test the code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to Design Programs

When designing functions for a program it’s a good idea to have a wish list.
What does a wish list entry contain?

A

A meaningful name, a signature, and a purpose statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to Design Programs

Recipe for designing a program (4 steps):

A
  1. Define constants
  2. Design a data representation for all possible states (Choose simple forms of data)
  3. Design a number of functions
  4. Create a main function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to Design Programs

Good programmers establish ___________ for all aspects of their programs.

A

a single point of control

How well did you know this?
1
Not at all
2
3
4
5
Perfectly