Question: I need help with these problems in program language C. I have the first problem done but need help with the functions and how to

I need help with these problems in program language C. I have the first problem done but need help with the functions and how to call them in main. I attached the problem for part 1 so you can see what that is since there is parts of it in part 2. Thank you for the help in advance.I need help with these problems in program language C. I havethe first problem done but need help with the functions and howto call them in main. I attached the problem for part 1so you can see what that is since there is parts of

3. Create the following functions in prob3a.c. I have already created display_bmi for you as an example: a. double get_weight (void) // prompts the user for weight in pounds, and returns the weight b. double get_height_feet (void) // prompts the user for height in feet, and returns the height c. double get_height_inches (void) // prompts the user for remaining height in inches, and returns the height d. double convert_feet_to_inches (double height_in_feet) // converts the height of the user from feet to inches, and returns the height in inches e. double calculate_bmi (double weight_in_pounds, double height_in_feet) // evaluates the BMI based on weight in pounds and height in inches, and returns the BMI - call convert_feet_to_inches () 4. Follow the comment example for display_bmi and comment all functions. Similarly, modify the comments at the top of main3a.c and prob3a.c to match your details. 5. Instead of using two different functions to return the feet and inches of the height, we can use pointers to modify them both at the same time. void get_height (int *height_feet, int *height_inches) By inputting the pointer (address) as the input parameter, we can modify the original variable by dereferencing (*) the pointer. Remember, we can get the address of a variable using the & operator. Create and define the get_height function. You'll need to uncomment the function prototype in the prob3a.h file. Call the lab TA and demonstrate the program working. The TA will enter their own test inputs, if your program outputs the correct values the lab TA will check you off. The TA will also scan through your functions to see if they were done correctly. Example Output: Termite 3.4 (by CompuPhase) - DX S ettings Clear About Close COM3 115200 bps, 8N1, no handshake Hello, Lab 3 Problema Height (Feet): 5 Height (Inches): 5 Weight (Pounds): 190 Weight 190 lbs Height: 65 inches BMI: 31.614201 Lab 3 Rev. 3 Advanced C Programming: Functions, Conditionals, and Loops 3.7 Problem 3b Daily Calorie Expenditure Calculator In the second problem of this lab, we will continue practicing creating functions, using the 3- file format/organization, and using conditional statements. This lab will write a Calorie Calculator program to determine what a person's caloric intake should be for a 24-hour span. The program must make a decision about caloric intake, to maintain current body weight, based on gender, age, weight, and height, and activity level. To determine total daily calorie needs, we first must compute the Basal Metabolic Rate (BMR). The BMR formula is the following: Women: BMR = 655+ (4.35* weight in pounds) + (4.7 * height in inches) - (4.7 * age in years) Men: BMR = 66 + (6.23 * weight in pounds) + (12.7 * height in inches) - (6.8 * age in years) To determine the total daily calorie needs, your program must apply the following guidelines: 1. Sedentary (little to no exercise): Calories = BMR * 1.2 2. Low activity: Calories = BMR * 1.375 3. Moderate activity: Calories = BMR * 1.55 4. High activity: Calories = BMR * 1.725 5. Extra activity: Calories = BMR * 1.9 Procedure To start, create a Keil project using the same procedures as Lab 1. The only difference is that you should use main3b.c instead of main.c and include both prob3b.c and prob3b.h. Define functions where appropriate! Prompt the user for age (assume 10-99), gender, activity level, weight, and height values. Reuse functions from problem 3a when you can! Output the result. Comment all functions. Similarly, modify the comments at the top of main3b.c and prob3b.c to match your details. Some details: - You can use 'M' or 'F' for gender input. - Use a switch statement on activity level to calculate final calories. Call the lab TA and demonstrate the program working. The TA will enter their own test inputs, if your program outputs the correct values the lab TA will check you off. The TA will also scan through your functions to see if they were done correctly Example Output: Lab 3 Rev. 3 Advanced C Programming: Functions, Conditionals, and Loops Termite 3.4 (by CompuPhase) - x Settings Clear About Close COM3 115200 bps, 8N1, no handshake Hello, Lab 3 Problem b Age (10-99): 29 Age Calc: 29 Gender (M/F):M Height (Feet): 5 Height (Inches): 5 Weight (Pounds): 190 Weight: 190 lbs Activity Levels 1. Sedentary (little to no exercise) 2. Low activity 3. Moderate activity 4. High activity 5. Extra activity Enter activity level: 3 Calories: 2910.900000 3.8 Problem 3c GPA Calculator In the third problem of this lab, we will continue practicing creating functions, using the 3-file format/organization, using conditional statements, and loops. This lab will write a GPA calculator program to determine the GPA of a person who has taken five classes. Grades to Grade Points - A=4 points - B= 3 points - C= 2 points D= 1 points - F = 0 points Procedure To start, create a Keil project using the same procedures as Lab 1. The only difference is that you should use main3c.c instead of main.c and include both prob3c.c and prob3c.h. Define functions where appropriate! Comment all functions. Similarly, modify the comments at the top of main3c.c and prob3c.c to match your details. 1. Ask for the grades and credits of five classes. Place each grade and credit into a separate variable (e.g., char gradel, char grade2, int credit], int credit2, etc.). 2. Calculate the amount of grade points for each class (switch statement is appropriate here) 3. Calculate the total sum of credits 4. Calculate the GPA using (2) and (3). 5. Instead of using separate variables for each class, reimplement this problem using arrays (e.g., char grade[5]). You can use pointer notation for arrays if you pass them into functions (Remember that arrays are essentially a pointer to the first element). Lab 3 Rev. 3 Advanced C Programming: Functions, Conditionals, and Loops Example Output: Termite 3.4 (by CompuPhase) COM3 115200 bps, 8N1, no handshake Hello, Lab 3! Problem - 0x About Close Settings clear Class 1 grade (A-F): A Class 1 credits (1-5): 3 Class 2 grade (A-F): D Class 2 credits (1-5): 2 Class 3 grade (A-F): B Class 3 credits (1-5): 4 Class 4 grade (A-F): A Class 4 credits (1-5): 3 Class 5 grade (A-F):C Class 5 credits (1-5): 2 Total Grade Points: 42 Total Credits: 14 GPA 3.000000 3.9 Problem 3d Error Checking In the fourth problem of this lab, we will continue practicing using conditional statements and loops. For all user inputs in problems 3a 3c, do error checking on an erroneous input, the program should print an error and ask the user again for the input). For example, in problem 3b, if the user enters 'D' for gender, the program should print out "ERROR: D is an invalid input then print out Gender (M/F): "again. What is the most appropriate loop here

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!