Project 1
Here is the Project 1 pseudo-code we
discussed in class.
We want the projects to be team efforts. Get together with one or
two of your friends to do this. Don't drive yourself crazy; use a
sane programming approach.
Write a program that plays a Randolph School guessing game.
- Create an array that contains a list of all of the first
names of the students of the Upper School.
- Write a loop that does the following:
- Set the initial "misses" to 0.
- Randomly select a name from the array. Hint: Use the function example that we showed you in class.
- Ask for a name.
- When the user enters a name, check the list to make sure it's a
valid name from the Upper School.
- If not, make a comment "imaginary friends don't count" and
return to the top of the loop (and ask for a new name.)
- Compare the name to the one that was randomly picked.
- If the name matches, print out a "right! you won!" message and
end the game.
- If the name doesn't match, add 1 to the misses.
- If the misses equal 5, print "you lose" and end the game.
- Otherwise, go to top of loop.
- Extras:
- Make the number of allowed misses an input parameter to the
program.