Due: Thursday, Feb. 10 by midnight
20 points
In your cps006 directory, you should create an assign2 directory to work in. You'll then copy files into this directory to help you get started. That is, type the following unix commands from your account after you login (don't forget the trailing dot on the last line).
If you did these commands correctly, typing pwd should show that you are in your assign2 directory, and typing ls should show the file Makefile.
You might want to refer to lab1 for information on editing, compiling and running programs.
Note that 20% of your program grade is based on the readability of your program. This includes things like style, comments, and the naming of variables and functions. Make sure you include a comment at the top of each program with your name, course and purpose of the program specified.
YOUR NAME HERE
To print a double quote you'll need to use an escape character, i.e., \" prints a quote, so that
enter color and animal: brown bear enter another color and animal: red bird brown bear, brown bear, what do you see? I see a red bird looking at me. enter another color and animal: purple cat red bird, red bird, what do you see? I see a purple cat looking at me. enter another color and animal: blue horse purple cat, purple cat, what do you see? I see a blue horse looking at me.
Note that the color and animal at the end of the second line of a verse is the same color and animal on the first line of the next verse. Also note the blank lines around each verse.
If you don't include any functions other than main in your program you'll be duplicating a lot of code. In general it's not a good idea to duplicate code so you should almost certainly include functions to generate the output. Your program must prompt the use for four different animals as shown in the example run above. User-entered strings are separated by white space so two variables are needed to store "brown" and "bear" in the example above.
prompt> enter number of seconds: 20000 20000 seconds = 5 hours, 33 minutes, and 20 seconds
You'll probably want to use the operators / and % to make your calculations. Extra credit if your program prints the number of days whenever the hours are more than 24 (you'll need to peek into chapter four for help with this).
When all your programs compile and produce the correct output, create a file named README (please use all capital letters in naming the file). In the file include your name, section number, the date, and an estimate of how long you worked on the assignment . You must also include a list of names of all those people with whom you consulted on the assignment.
To submit your programs electronically type:
submit_cps006 assign2 printname.cpp webpage.cpp sight.cpp seconds.cpp README
The executables are accessible from /usr/local/bin/submit_cps006 on CS machines and /afs/acpub/project/cps/bin/submit_cps006 on the acpub system. You should receive a message telling you that the programs were submitted correctly.
To see that the programs were submitted correctly, type
submit_cps0066 assign2
with no arguments and a list of the files submitted will be shown.