Write a Program that has a menu with a layout below, that asks the user if they want to:
1. Converts from feet and inches to meter and centimeters
2. Converts from meter and centimeters to feet and inches
3. Quit the program
The program should continue as long as the user asks it to.
The program will use a switch statement for the menu option selection. Either a do loo or a do-while loop can be used for the overall program operation in main. Make sure your while or do-while statement is a conditional one (for example, while(loop=='y')) to keep looping.
Reminder to not use any global variables except for constants, which should be in caps.
Use a function for menu, the Eng2Metric and Metric2Eng functions which are not required to return not accept and inputs.
For example, the Eng2metric function will ask the user to enter the feet and inches and output the meters in a fraction as in something like 1.45 meters.
C++ code
============================================================================================
#include<iostream>
using namespace std;
void menu(int &opt)
{
cout<<"1. Converts from feet and inches to meter
and centimeters\n";
cout<<"2. Converts from meter and centimeters to
feet and inches\n";
cout<<"3. Quit the program\n";
cout<<"Enter your choice: ";
cin>>opt;
}
void Metric2Eng()
{
float feet,inches,meter,cm;
cout<<"Enter the meter:
";
cin>>meter;
cout<<"Enter centimeter:
";
cin>>cm;
meter=meter+(cm/100);
//cout<<"meter is
:"<<meter<<endl;
feet=3.281*meter;
//cout<<"feet is:
"<<feet<<endl;
//find feet and incehs
int feet1 = int(feet);
double fractionalFoot = feet -
feet1;
inches = fractionalFoot *
12.0;
cout<<"Height is:
"<<feet1<<"ft and "<<inches<<"
in"<<endl;
}
void Eng2Metric()
{
float feet,inches,meter,cm;
cout<<"enter the feet: ";
cin>>feet;
cout<<"enter the inches: ";
cin>>inches;
feet=feet+(inches/12);
meter=0.305*feet;
cm=meter*100;
cout<<"Height is "<<meter<<"
meter"<<endl;
}
int main()
{
char ch='y';
int opt;
do
{
menu(opt);
switch(opt)
{
case 1:
Eng2Metric();
break;
case 2:
Metric2Eng();
break;
case 3:
return 0;
break;
default:
cout<<"Wrong option selected\n";
}
cout<<"Do you want to continue(y/n): ";
cin>>ch;
}while(ch=='y');
return 0;
}
============================================================================================
Output

Write a Program that has a menu with a layout below, that asks the user if they...
Python Programming 4th Edition: Write a program that asks the user for the number of feet. The program converts those feet to inches by using the formula ’12 * feet’. Hint: Define main () program Get the number of feet from the user Define variables Call a function feet_to_inches(feet) The function receives the number of feet and returns the number of inches in that many feet. The output should look like as follows: Enter the number of feet: If the...
Need help with following C++ program: 3) Write a program in C++ with a menu. When the program executes it gives the user a list of choice to choose from. The user can input 1,2 or 3 only. For all other input, the message “Invalid Options” will be displayed. ****MENU**** 1) Convert length from feet to inches. 2) Convert length from meter to centimeters. 3) To quit the program
. Write a program that reads in a length in feet and inches and outputs the equivalent length in meters and centimeters. Use at least three functions: one for input, one or more for calculating, and one for output. Include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. There are 0.3048 meters in a foot, 100 centimeters in a meter, and 12 inches...
Java COSC 237 Problem: You are to develop a program that allows a user to convert lengths in the metric system (i.e., meters/centimeters) to the Imperial system (i.e., feet/inches) AND convert lengths in the Imperial system to the metric system. Specifications • Input may be given with or without decimal places. • Error checking for invalid input is not required. • The results are to be displayed with two decimal places of precision. (For example, 2 meters, 25 centimeters (225...
21 Write a program that asks the user to input the length and breadth of a soccer field, and then computes and returns the number of square meters of grass required to cover the field The formula for the area is the product of length and breadth (5) 22 The following program uses the break statement to terminate an infinite while loop to print 5 numbers Rewrite the program to use a while loop to display numbers from 1 to...
Project 1, Program Design 1. Write a C program replace.c that asks the user to enter a three-digit integer and then replace each digit by the sum of that digit plus 6 modulus 10. If the integer entered is less than 100 or greater than 999, output an error message and abort the program. A sample input/output: Enter a three-digit number: 928 Output: 584 2. Write a C program convert.c that displays menus for converting length and calculates the result....
Write codes that will produce the screen as shown Firstly, the program prompts user to enter his name. Then it will display Hello <user name>. Next it prints out a menu which contains 5 options (1- add two integers, 2- add two strings, 3- compute factorial, 4- reverse a string, 5- quit program). Code all 5 tasks appropriately. When the task is completed (not including quitting program of course), the menu pops up again and asks user to try...
java program
QUESTION 2: 1. Write a do-while loop that asks the user to select a task from the following menu to continue: 1. Option 1 2. Option 2 3. Option 3 4. Option 4 5. Exit Read the selection from the keyboard then write the switch statement: For option 1, display the message "Do the option 1" For option 2, display the message "Do the option 2" For option 3, display the message "Do the option 3" For option...
Java Letter Counter: Write a program that asks the user to enter a string, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the string. Must use a do while loop and a counter!!!!
In C++, Write a program that reads in a length in meters and will output the equivalent length in feet and inches. Express feet as an integer and inches to the nearest 1/100 of an inch. You must write and use a function that uses the following function prototype to perform the calculation: void MtoFtIn(double meters, int& feet, double& inches); The function should not input any data or print any results, it only does the calculation. Include a loop that...