UMBC CMSC104 CSEE

Project 3

DUE: 21 April

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. You must ask the user for their age. The age must be greater than 12. Also the age must be lower than 100, since we don't have any students that old!

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:
/*****************************************************/
/* Program Header Block                              */
/* Filename:       6789prj2.c                        */
/* Name:           Ima Student                       */
/* SSAN:           6789                              */
/* Date:           6 April 2004                      */
/* Course/section: CMSC-104/0101                     */
/* Description:                                      */
/*     Analysis:                                     */
/*         Input:                                    */
/*         Output:                                   */
/*         Constraints:                              */
/*         Formulas:                                 */
/*         Assumptions:                              */
/*     Design:                                       */
/*         (Your psuedocode goes here.)              */
/*                                                   */
/* Notes:          (As needed.)                      */
/*****************************************************/

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 | CSEE |