Student Name:
Class/Section:
Professor Name:
Assignment due date:
1. Problem definition: 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.
Note: Your problem analysis should have already been submitted as part 1 of the assignment. A. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode.
The following items are the things the program must do: * Declare the age, name and state arrays for the family members * The enter values by the users will decide the arrays * The loop will consist of the input of the state, name, age * It will calculate the average age of members and names who reside in Texas * Results of the average age and names of family members who live in Texas
The user will enter 10 family members name, age, and place of residence (state) to be stored in the arrays listed below. With a one to one correspondence for arrays sState, sName, and iAge, family members name will be entered in sName array and will have their state and age entered in sState and iAge arrays respectively.
Variables will be defined as: * sState – string array to hold the state * sName – string array to hold the name * iAge – integer array to hold the age * iCount – integer to hold the count
The Main module will contain the following submodules: * CalcAvgAge * PntTexans
Formula Examples
Calculating Average Age:
Average Age = (total of all family members ages)/(total number of family member)
Example: iCount = 4 and iAge[0]=7 ; iAge[1]=52 ; iAge[2]=30 ; iAge[3]=16
CalcAvgAge = (iAge[0] + iAge[1] + iAge[2] + iAge[3])/ (iCount)
7+52+30+16/4 = 26
Average Age = 26
Print Texans:
In sState array, you will be