Cmis 102 Final

Submitted by: Submitted by

Views: 49

Words: 339

Pages: 2

Category: Science and Technology

Date Submitted: 04/01/2015 11:35 AM

Report This Essay

Final Project Plan

CMIS 102

Description

This program will allow a user to input a list of family members along with their age and state where they reside. It will print the average age of the family and print the names of anyone who lives in Texas.

Analysis

For the purpose of this program, the user will be asked a series of questions requiring the input of name, age, and state for each of their family member until the number of family members is met. In order to carry out the given task of finding the average age of family members along with the ones who live in Texas, the program should include the function of calculating and displaying the age. It should also include the ability to take the input of family names and print the family members who are only from Texas.

Program Design

Required outputs include:

Average family age

Names of family members only from Texas

Required Inputs:

Names of family members

Ages of family members

States where the family members reside

Variable Declarations/Definitions:

String array (s_Names/s_State) to hold names/states

Integer array (i_Age/i_Count) to hold ages/family members

The information the user inputs (age, name, state) will be stored in the arrays as defined above.

Calculations:

Average Age- Average age=(sum of ages of family members) divided by (number of family members provided)

(Example) i_Count=6

i_Age[0]=15, i_Age[1]=25, i_Age[2]=13, i_Age[3]=56, i_Age[4]=70, i_Age[5]=50

The f_avAge= i_Age[0] + i_Age[1] + i_Age[2] +i_Age[3] + i_Age[4] + i_Age [5] divided by i_Count (15+25+13+56+70+50/6=38)

Finding Family Members From Texas- In the s_State array, it looks for indicators containing the string “Texas” and prints the corresponding elements in the s_Names.

(Example) s_State[3]=”Texas”, s_State[4]= “Texas”, s_State[5]=”Texas” and the names in the Name array are the following:

s_Names[0]= Joe

s_Names[1]= Lydia

s_Names[2]= Hailey

s_Names[3]= Sarah

s_Names[4]= Chris

s_Names[5]= Shelly