Reference no: EM132410302
CPT111 Principles of Programming Assignment - University of Science, Malaysia
PROBLEM STATEMENTS - "Malaysia is Asia's fattest country with approximately half of the population overweight or obese.
Obesity means having too much body fat. It is different from being overweight i.e. weighing too much. Both terms mean that a person's weight is greater than that considered healthy for his or her height...
Obesity can lead to serious and potentially life-threatening conditions like cardiovascular disease, diabetes, stroke, gall stones, and some cancers like breast, uterine and colon cancer.
It affects quality of life and causes physical changes like breathlessness, snoring, sleep apnea, tiredness, difficulty with physical activity and arthritis. It can also lead to psychological conditions like low self-esteem and depression."
In accordance with the news, USM make an effort to promote a healthy lifestyle by keeping track of the Body Mass Index (BMI) of each staff. As a programmer in a software solution company, you are appointed to develop an application called Let's Get Fit (LGF) which calculate the BMI for every USM staff. Based on the calculated BMI, you can identify body weight category of a person as shown in Table 1.
Table 1: Weight Categories using BMI Scale
|
BMI
|
Weight category
|
< 20
|
Underweight
|
20 <= BMI < 25
|
Normal weight
|
25 <= BMI < 30
|
Overweight
|
>= 30
|
Obese
|
The program should read data from a text file which contain the following USM's staff information:
Name
Staff ID
Gender
Age
Weight (kg)
Height (cm)
These data are read from a text file and must be stored in appropriate arrays which will then be used to compute BMI, Basal Metabolic Rate (BMR) and Resting Metabolic Rate (RMR) for each person using Table 2 attached. This information is then written into an output file after new information is added.
As a programmer, you should use your own creativity to provide meaningful and interesting information to be displayed on the screen. You should use menu in order to have a full control of the program execution.
The program should be able to make simple search of a specific criterion, e.g: search for BMI, BMR and RMR of individual based on staff ID, gender and age. It could also able to search for combinational criteria, e.g.: search for all staff with BMI less than 25 and also more than 35 years old and etc.. Apart from these, the program should be able to produce statistical distribution based on Table 1, e.g., display the number of overweight women between 30 - 50 years old. In addition, you may want to do some processing on the available data in order for a person to achieve certain target, e.g. How many calories consumption one must take in order to lose 2 kg in 1 month without starving themselves?
The program must at least able to do the following:
I. Read data from input file specified by user
II. Read data from user (add new staff information)
III. Continue the program until the user ask to stop
IV. Provide a menu for user
V. Search for specific information
VI. Search for combinational information
VII. Modify the selective information (age and weight)
VIII. Automatically recalculate the value of BMI, BMR and RMR upon changes of age and weight of any individual
IX. Present minimal statistical information
X. Produce an output file
Your design should fulfil the following requirements:
General requirements:
I. Input validation
II. Interactive menu
III. Good Interface Design (i.e. Presentable manner and easy to understand)
IV. Meaningful comments in the source codes
Specific requirements:
I. Your program should demonstrate the use of user defined functions and passing parameters by value, arrays and reference
II. Read data only once from a text file and store them into appropriate array(s)
III. Data must be retrieved and processed from array(s)
The program must NOT:
I. Use pointer of array
II. Use build in library <vector>
III. Open the same file more than once and close it more than once. Use appropriate file stream and access flags.
IV. Allow the program terminated without the consent of the user.
V. Use global variables.
Attachment:- Principles of Programming Assignment File.rar