UMBC CMSC104 CSEE | CMSC104 | Lectures

Project 3 DUE: 4 Dec

Updated Requirements 27 Nov

You must make sure that all ages are greater than zero, that all ages are less than some value (maybe 150 or something reasonable), and that the parent is older than the child. If the ages are not valid, then make the user re-enter the ages.

Requirements Specfication

Write a program that will figure out how old you will be when your age is 75 percent of your mother's age. (If you prefer, you can use your father's age.) For this project, use integers and instead of testing for equality (==), test for greater than or equal. Otherwise, you might end up in an endless loop. You calculate the percentage by dividing your age by your parent's age.

Since you are not at that percentage now, you will have to keep trying ages until you get there, so use a loop and keep adding one to both ages until you get to the goal.

You must use functions for the following:

Example Input/Output

In the following example, the program displays what is in Blue. The user's input is in red.

What is your age? 20
What is yor parent's age:  40
When you are 60, you will be 75% of your parent's age. 

    

Program Header Comment Block

Use the following comment block at the beginning of your source code:
/***********************************************************
 * Filename:       proj3.c                                 *
 * Name:           Ima Student                             *
 * SSAN:           6789                                    * 
 * Date:           3 October 2000                          *
 * Course:         CMSC-104                                * 
 * Description:    (Your psuedocode for main() goes here)  *
 * Notes:          (As needed, such has how to compile)    *
 ***********************************************************/

Function Header Comment Block (One for each function)

/*********************************************************** 
 * Function name:    function_name                         *
 * Description:      (Your function psuedocode goes here)  *
 * Input Parameters: Name and data type of each parameter. *
 * Return Value:     Data type and description of what     *
 *                   the return value is.                  * 
 ***********************************************************/
  


UMBC CMSC104 CSEE | CMSC104 | Lectures