Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Add Numbers

You are given a pile of index cards with numbers written on them. Your job is to add them up, write their sum on a sticky note, and return the sticky note to whoever gave it to you.

Remember, you can only look at the numbers one at a time. You will have to add several two-and-three-digit numbers together and keep track of their running total.

Since adding numbers is time consuming and error prone, you are free to use a calculator or other device to calculate the sum of two numbers. Pretend this is another computer or subroutine you have access to.

Describe the Process

Describe the process you carried out in English. You should describe what to put on sticky notes and when, when to flip cards, what to do with the information you can see at each step, and when to return the sticky note with the answer.

You can use any terminology and symbols you want. You are free to give names to different pieces of information, e.g., the pile of index cards, the number you're currently looking at, the sticky note(s) you're writing on, etc.

If you used a calculator or other device to add up pairs of numbers then make sure to include that.

If you want, pretend there's another procedure/process/subtroutine/function called "add": you give it two numbers and it gives you back their sum.

Looking at Code

Look first at pseudocode.md and convince yourself that this describe a process that will answer whether a specific number is in the pile. Put your description with the pseudocode side by side.

Next, look at syntax.md to see the process. This contains actual implementations in multiple languages. Do you see how these programs represent the same procedure as your description and the pseudocode?

Put them side by side with the pseudocode and your description. Take note of which pieces of syntax map to something you understand and which pieces don't. Many of these pieces of syntax you can search for.