Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

and please don't forget the report answer 1 has been solve you can use it as reference Answer : sorry this one part 2 of

image text in transcribed

and please don't forget the report

image text in transcribed

answer 1 has been solve you can use it as reference

image text in transcribed

Answer :

image text in transcribed

image text in transcribed

image text in transcribed

sorry this one part 2 of question 2

image text in transcribed

actually question number 1 and 2 connected,question no1 already answerd,so I want the code for number 2 and the report.

This is the whole project

image text in transcribed

image text in transcribed

this is the code for number 1: Project 1 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

image text in transcribed

image text in transcribed

(need answer for no 2 and report )for report please consider this (Report - 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)

question no 1 has been solved already.

question no 1 and 2 contacted I just post it separately because of the terms of chegg.

question no 1 solution : Project 1 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.

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 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%) Write a complete C 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. The program is able to a. 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 c. Calculate the number of student for eachcategory d. Find and display the average BMI of all students and average category. e. Ask the user to enter category and display the name of students in this category onthe screen as shown below (Figurel.2) Figure 1.2: output on the screen 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,1 = 0,OW = 0, 0 = 0; if (BMI[i] 18.5 && BMI[i] 25 && BMI[i] 30){ printf("Obese"); O++; printf("number of obese students = %d", } BMI[i]=+ BMI[i]; //Display average BMI if (BMI[i] 18.5 && BMI[i] 25 && BMI[i] 30){ printf("Obese"); } } }//end of main function 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, Project 1 Write a complete C 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. The program is able to a. 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 c. Calculate the number of student for eachcategory d. Find and display the average BMI of all students and average category. e. 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. Project 1 Write a complete C 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. The program is able to a. 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 C. Calculate the number of student for eachcategory d. 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 Figurel.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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory Icdt 97 6th International Conference Delphi Greece January 8 10 1997 Proceedings Lncs 1186

Authors: Foto N. Afrati ,Phokion G. Kolaitis

1st Edition

3540622225, 978-3540622222

More Books

Students also viewed these Databases questions

Question

3. Contrast relational contexts in organizations

Answered: 1 week ago

Question

2. Describe ways in which organizational culture is communicated

Answered: 1 week ago

Question

1. Describe and compare approaches to managing an organization

Answered: 1 week ago