Question: question no 1 has been solved already. (need answer for rest and report ) Project guidlines : (please read it well) ((((All questions are connected

 question no 1 has been solved already. (need answer for rest

and report ) Project guidlines : (please read it well) ((((All questions

question no 1 has been solved already.

(need answer for rest and report )

Project guidlines :

are connected )))) below answer no 1 to be able to work

(please read it well)

((((All questions are connected ))))

below answer no 1 to be able to work on :

Answer 1: #include #include void main() { //Calculation of BMI int age[10],height[10],weight[10]; int i; float BMI[10]; printf("enter age of student:",age); scanf("%d",&age); printf("enter height of student:",height); scanf("%d",&height); printf("enter weight of student:",weight); scanf("%d",&weight); for(i=0;i 18){ BMI[i] = weight[i]/height[i]^2; printf("BMI = %f",BMI[i]); } /* b)Display category c)Calculate number of students in each category UW : number of underweight students N : number of normal students OW : number of overweight students O : number of obese students*/ int UW = 0,N = 0,OW = 0, O = 0; if (BMI[i] 18.5 && BMI[i] 25 && BMI[i] 30){ printf("Obese"); O++; printf("number of obese students = %d",O); } BMI[i]=+ BMI[i]; //Display average BMI if (BMI[i] 18.5 && BMI[i] 25 && BMI[i] 30){ printf("Obese"); } } }//end of main function

Project 1 Write a complete program that reads in a list of data (Name of student, Age, height in centimeter and weight in Kilogram) from an input file as shown below (Figure 1.1). You have to preparea data file as shown in Figure 1.1 with data at least for 10 students and cover all situations, Salina binti Abu Tan Tin Tun Muhammad Aiman Marina Chin 15 154 25 180 19170 23 160 65 70 55 60 Figure 1.1: input file 1. a. The program is able to CalculatetheBMI(bodymassindex)ofstudentsbasedontheirweight,height and age.(use formula ofBMI below). Age 18 BMI-(weight(kg)/height(m)) b. Determine and display the category of each student asfollows. underweight BMI less than 18.5 Normalweight BMI between 18.5 and 24.9 overweight BMI between 25 and 29.9 obese BMI 30 and above d Calculate the number of student for eachcategory Find and display the average BMI of all students and average category. Ask the user to enter category and display the name of students in this category onthe screen as shown below (Figure 1.2) Figure 1.2: output on the screen 2. The output of this program should be displayed into the output file as shown in Figure 1.3 Name Age height (m) weight (kg) BMI Category Salina binti Abu Tan Tin Tun Muhammad Aiman Marina Chin 15 25 19 23 1.54 1.80 1.70 1.60 65.0 70.0 52.0 60.0 32.9 21.61 17.99 23.44 obese normalweight underweight normalweight Figure 1.3: output file 3. The number of student is based on the input data from filedata. 4. Use array (one-dimension or two-dimension) to store the input data from file and the outputdata. 5. The program should be written in several user-defined functions for example calBMI () function to calculate BMI, category () function to find category of each student, etc. Each function must be implemented with the concept of parameter passing. Use appropriate arguments for each function. Do not use global variables. 3. Report (10%) - consist of description of input and output file, explanation on user interface (snapshot/print screen of your output), explanation of main program, and all functions, 4. C source Code that must contains at least the following checklist. Therefore, write you program so that it consists the following list. Discuss with lecturer if necessary to modify the project description so that the description will consist all the following element of C element. (70%) a. Comment b. Indentation c. Printf scanf simple d. Formatted input output e. IF f. Nested IF g. SWITCH h. Simple FOR i. Nested FOR do....while k. while.. do 1. File input output m. Array up to 2 dimension n. Function (three categories function, return value function, void function only with passing argument, void function with passing argument and return parameter value)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!