Microsoft Word - Document1
ELET 2300: Introduction to C++ Programming Fall 2020
Lab 2
Deadline: Fr. October 16, 11:00 PM
Please work on the following labs and submit your solutions on a single .txt file
1. Write a menu driven C++ program that performs the following operations (use switch
case):
a. Convert Miles to Kilometers
. Convert degrees Fahrenheit to degrees Celsius
c. Convert Kilograms to Pounds
Display appropriate message if the user enters a wrong option.
2. Write a C++ program that accepts the weight and height from the user. Calculate the
BMI of the user and print the result based on the following rules:
- If BMI < 20 then result = Underweight
- If BMI >= 20 and <= 24 then result = Normal Weight
- If BMI >= 25 and <= 29 then result = Overweight
- If BMI >= 30 and <= 39 then result = Obese
- If BMI >= 40 then result = Extreme Obesity
3. Write a C++ program with a user defined function myFactorial, that calculates the
factorial of a number entered by the user. Return the calculated factorial and print it in
the main function.