C LANGUAGE Write a menu-driven program for the following, use case/switch statement: LOL MENU 1. QUADRATIC EQUATION 2. BMI CALCULATOR 3. SUM OF ODD NUMBERS 4. EXIT CHOICE: NOTE: Input another choice, if the choice is invalid.
IN C LANGUAGE
Write a menu-driven program for the following, use case/switch statement:
LOL MENU
1. QUADRATIC EQUATION
2. BMI CALCULATOR
3. SUM OF ODD NUMBERS
4. EXIT
CHOICE:
NOTE: Input another choice, if the choice is invalid.
Case 1: password to open: 1111 (back to main if the password is invalid)
Create a program that will calculate and display the real roots of the quadratic equation: ax2 + bx + c = 0 using the quadratic formula: x = (-b ± sqrt of b2 - 4ac) / 2a
Make sure that the b2 > 4ac, so that the calculated roots will always be real. And that a must not be equivalent or less than 0.
Note: Back to main after performing case 1 or exit
Case 2: password to open: 1234 (back to main if the password is invalid)
Create a program that will calculate Body Mass Index (BMI) and will indicate the status of your BMI. Using ladderized if-else.
BMI = ([Weight in Pounds) / (Height in inches) x (Height in inches)] x 703
BMI = (Weight in Kilograms) / (Height in meters) x (Height in meters)
Your program must accept weight in pounds or kilogram, and height in inches or meters.
Formula:
1 ft = 12 inches
1 meter = 39.3701 iches
1 in = 0.0254 m
1 kg = 2.2 lb
1 lb = 0.454 kg
BMI Categories:
Underweight = <18.5
Normal weight = 18.5 - 24.9
Overweight = 25 - 29.9
Obesity = BMI of 30 or greater
Sample Program:
Weight (Input 1 for Lb, input 2 for kg): 1
Input weight in Lb: 220
Height (Input 1 for inches, input 2 for meters): 2
Input height in meters: 2
Your BMI is: 24.9
BMI Category: NORMAL WEIGHT
Note: Back to main after performing case 2 or exit
Case 3: password to open: 1011 (back to main if the password is invalid)
Write a program that will compute for the sum of 10 odd numbers only beginning on user's input: (use do-while loop)
Sample:
Input a number: 4 (if the input number is even, add 1 to make it odd)
Ten odd numbers beginning at 4: 5, 7, 9, 11, 13, 15, 17, 19, 21, 23
Sum: 140
Note: Back to main after performing case 3 or exit
-End-
Step by step
Solved in 5 steps with 6 images