|
course.wilkes.edu/CS125Labs |
||||||
Hands On C++: Project 5
Objectives
1. Practice using selective behavior.
IntroductionYour instructor will tell you which one of the following projects to do.
Projects
5.1. There are three possible sources of user error in
assert() to guard against these errors,
but the diagnostic message displayed by assert() is not particularly
informative or user-friendly.
Replace each of the calls to assert() in calculate.cpp
with a selective-behavior statement that displays a more user-friendly
diagnostic message and terminates the program (using exit() from
cstdlib.h) if the user enters erroneous information.
5.2. Write a menu-driven "police sketch artist" program. The program should use four different menus for:
-----
| | ....... |||||||/
--------- . . | |
(| O O |) (|-0-0-|) (| . . |)
| _ | | ^ | | > |
|\___/| | --- | |||-|||
----- ----- |||||
|||
Organize your program in such a way that it contains no redundant code.
For each of the user's choices, write a separate function to process
that choice.
5.3. A year is a leap year if it is evenly divisible by 4, unless it is divisible by 100, in which case it must also be divisible by 400. That is, 1996 was a leap year because it is divisible by 4 and not 100, 1997 was not a leap year because it is not divisible by 4, 2000 will be a leap year because it is divisible by 4 and 400, but 2100 will not be a leap year because it is divisible by 4 and 100 but not 400.
Write a
5.4. Using the
Turn In:
Don't forget to clean up your directory when you are all finished...
|
Home Membership
|
|||||
|
Last update: Wednesday, August 23, 2000 at 1:42:23 PM. |
||||||