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...

1 answer below »
attached below


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 b. 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.
Answered Same DayOct 16, 2021

Answer To: Microsoft Word - Document1 ELET 2300: Introduction to C++ Programming Fall 2020 Lab 2 Deadline: Fr....

Shivam answered on Oct 16 2021
145 Votes
Program 1
#include
using namespace std;
int main() {
int num;
cout << "Ente
r 1 if you wish to convert miles to kilometers \n";
cout << "Enter 2 if you wish to convert degrees Fahrenheit to degrees Celsius \n";
cout << "Enter 3 if you wish to convert Kilograms to Pounds"< while(1){
cin >> num;
if ((num == 1) || (num == 2) || (num == 3))
break;
else{
cout << "Please enter appropriate input" << endl;
}
}
switch (num) {
case 1:
float miles,temp;
cout <<"Enter miles";
cin>>miles;
temp = miles * 1.60934;
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here