CS 112 Major Lab #3
: Friday, November 9, 3pm.
: Submit printouts to me, and save a copy of the project in your network
Working alone, solve the following programming assignment. Keep in mind that academic
dishonesty is defined as the giving or receiving of unauthorized aid (see the course syllabus
for more details). Late programs are not accepted.
0. Grading policy
You will be graded primarily on design and correctness: a program that works correctly will
typically earn a score of 85 (out of 100), a program that doesn’t run is worth maybe 10-20
points. A program that runs but produces incorrect output is worth something in between;
you are responsible for testing your own programs.
Good programming design includes concepts such as letting the “worker” objects do the
work of reading and writing formatted data.
Basic efficiency includes using loops whenever appropriate.
The remaining 15 points of your grade will be based on commenting and readability. For
now, this means…
Each Java source file must contain a header comment, including your name, the date, the
lab assignment, and a brief summary of what the file represents.
You should also use readable variable names (e.g. “tictactoe” and “keyboard” instead of
“t” and “k”),
Use proper indentation to make your program easier to understand, and use whitespace
(i.e. blank lines) to separate blocks of your program & enhance readability.
Finally, comments must be added to all major sections of your program to describe what
each section is doing — for now this implies comments at the top of each method, the top
of each chain of if-then-else statements, and the top of each loop.
Social Security Administration
(SSA) provides a web site showing the distribution of
first names chosen for US kids over the last 100 years:
This data is interesting in many ways.
For example, you can witness ethnic trends in the US
population by the growing popularity of names such as Miguel, Mohammad and Samir.
also see the impact of pop culture — all of a sudden Trinity is a very popular name, why is that?
Note that the data is for
born in the US
, so ethnic trends don’t show up until the parents
starting having children here in the states.
For each name in the survey (of which there are about 5,000 total), the SSA’s data ranks
the name in popularity over the 20
Thus, each name in the survey has 11
rankings, representing the name’s popularity in 1900, 1910, 1920, …, 1990, and 2000.
example, here’s the data for the name “Trinity”:
Trinity 0 0 0 0 0 0 0 976 0 778 74