CMIS 1002 Assignment & rubric
Michael Brause
CMIS 102/6387
Professor Tony Baird
July 5, 2015
Program description: Design a program that will allow a user to input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas.
Analysis: The program is to calculate the total average of the family age and determine their location with only printing the family members living in Texas (TX). The program will allow the user to input the name, age and location of each family member. The program will take the years of all members entered, add them together, take the total of the family members entered (10) and divide the total coming up with the average age. The program will also calculate and identify where each family member resides (state) and identify those who are from Texas and print their names only. The output of the program is the total average age of all family member entries, identify who is from TX and print their name out. The required input and output is as follows:
Input:
-Persons name -Persons age -Persons state
Output:
-Average age of all persons entered. -Print names of people living in Texas (TX) only.
The program will take the inputs and calculate the average of all of the ages entered, identify which persons are from TX and print their name out. An array will be used to hold the data for calculating who is from Texas (TX). The program will do the following:
Declare name, age and state arrays for those members, Array will be up to the user entered values. It will take user input for name, age and state in a loop and it will calculate average age and identify who lives in TX.
Final function will print out average age, identify people’s names from TX and print it out. For this program, the user will be asked for name, age and state of their family members, one by one, until the user decides to stop entering this information. To achieve the given task (printing average family age and identifying residents of Texas), following modules needs to be created:
Main program: This module will be the one running on program startup. It will be responsible to get user input and call appropriate modules to calculate and display average family age and display family members which are residents of TX.
CalcavgAge program module: This module will take the family ages as input, count of family members as input, calculate and display the average family age. This module will be called within the Main program.
printTexans module: This module will take family names as input and will print the names of the family members from Texas. This module will be called within the main program.
Proffessor’s Comments:
I look forward to seeing your code.
2