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.
2. Problem Analysis:
The program will inform user to input family member name, age and state. The program will take the years of all members entered and add them together and then take the total of members entered (10) and divide the total coming up with the average age. The program will also calculate and identify each state of each person entered and using the defined input identifies those people from Texas and prints their names out only. The output of the program is three fold. The total average ...view middle of the document...
The program will also calculate and identify each state of each person entered and using the defined input identifies those people from Texas and prints their names out only. The output of the program is three fold. The total average age of all family entries, identify who is from TX and print their name out.
* Required input – Persons name
* Required input – Persons age
* Required input – Persons state
* Required output – average age of all persons entered
* Required output – print name of TX ONLY
a. The program will take inputs and calculate the average of all of the ages entered, identify which persons are from TX and print their name out.
b. An array will be used to hold the data for calculating who comes from TX
c. 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... [continue
Declare s_Names as String Array // Array to store names
Declare s_Age as Int Array // Array to store ages
Declare s_State as String Array // Array to store state of residence
Declare i_Count as Int // Variable to hold count of total family members
Declare f_avAvg as float // Variable to hold average family age
Declare lc as Int // loop counter
While (have more family members to enter) // loop to input family data
Display “Enter Member Name:”
Input s_Names(lc) // Input name
Display “Enter Member Age:”
Input s_Age(lc) // Input age
Display “Enter state”
Input s_State(lc) // Input state
Increment lc and i_Count
calcAverageAge(s_Age, i_Count) // Call module to calculate and display average age
call printTexans(s_Names, s_State, i_Count) // Print names of Texans