Before you start on the programming part of the assignment, estimate how long the program will be and how long it'll take you to write. Enter your estimates using the PSP forms (click on "Input" under "Product Plan Estimates").
While you work on the programs, keep track of all the error messages and other defects you encounter (click on "Input" under "Defect Removal Data"). (I recommend having a Web browser open while you work, so you can record each defect as you find it, rather than trying to remember them all later.)
While you work on the programs, keep track of how much time you spend on various phases of program development (click on "Input" under "Time Management Data"). Again, I recommend recording this stuff while you work rather than trying to reconstruct it after the fact.
Requirements modification, Feb. 25: There are now five suits: spades, hearts, diamonds, clubs, and fnords (represented by an F). There's a new rank above Ace: Professor (represented by a P); a Professor is treated as a face-card with a value of 5. There are ten cards in a hand, not thirteen. And a hand gets an extra point if it has exactly seven cards in a suit (in addition to the points it would have gotten otherwise).
Do problem 15, chapter 2, pp. 107-108 (on computing
xn). Note that parts a, b, and c ask you to write
a function (which you should test and debug); parts d and e should be
answered in writing and turned in along with the program.
To test this, you'll probably want to write a main program that gets
x and n from standard input, then calls each of the
functions in turn and prints the results.
Do problem 9 (chapter 2, pp. 105-106). This question asks "what output does the following program produce?", which technically you can answer just by typing it in and running it. So to make sure you understand the program, write an iterative program that prints the same sequence of "first" and "last" values for any given n.
Write a function that takes in two strings, a pattern and
a target, and determines whether the pattern "matches" the
target. The trick is that the pattern may contain "?" characters,
which match any single character in the target, and "*"
characters, which match any zero or more characters in the
target.
For example, the pattern "abc?de" matches the targets "abcxde" and
"abccde", but not "abcde" or "abcxyde".
Similarly, the pattern "abc*de" matches the targets "abcde", "abcxde",
"abcxyde", and "abcdedededede", but not "abcdededededed".
For that matter, the pattern "*abc?de*?f" matches the targets
"abcxdegf", "abcddegf", and "xyzabcadexyzf", but not "abcdef",
"abcdexf", "abcxdef", or "abcxdexfg".
To test this, you'll probably want to write a main program that gets
the pattern and the target from standard input, calls the matching
function, and prints out whether they matche or not. Since you'll have
a lot of test cases to try, it might save you some time to put this
inside some kind of loop.