Student Name: Elizabeth Flaim
Class/Section: CMIS 102, Section 7982
Professor Name: David Castillo
Assignment Due Date: December 14, 2014
Problem Definition: Design a program that allows a user to input a list of family members, along with their age and the state where they live. The program will determine and print the average age of the user’s family. The program will also print the names of any family member that lives in Texas. The program design should also allow the user to enter at least 50 family members.
A. Problem Analysis
Objective: Devise a program that will allow a user to input a list of family members with their age and state where they live. Once the list is complete, the program will calculate and print the average age of the user’s family and also print the names of any family members that live in Texas. All three items, the input, average, and printing family members from Texas will require the use of repetitive programming statements/loops.
Outputs:
Average age of the family
AverageAge (as a float variable)
Name of family member
Name (as a string variable array)
Inputs:
Name of family member
Name (as a string variable array)
Age of family member
Age (as an integer variable array)
State of family member
State (as an string variable array)
Derived Inputs:
Number of family members will be derived by adding the number of times that the user enters the names of family members into the program.
NumFamily (as an integer variable)
Sum of ages will be derived from a loop that runs the same number of times as there are family members, adding together the ages as the loop runs.
SumOfAges (as an integer variable)
Calculation Approach:
The average function will be used to calculate the average age of the family members. It works by dividing a sum of numbers by the number of numbers.
Function Average (Sum, Num)
Set Average = Sum / Num
End Function
The program will calculate the family members who live in