void main()
{
clrscr();
float a,b,area ,h,k,j;
char ch;
cout<<"Welcome to Area Calculator.\n"
"Please select a function to be performed.\n";
cout<<"C/c:Circle"<<endl;
cout<<"T/t:Triangle"<<endl;
cout<<"P/p:Parallelogram"<<endl;
cout<<"R/r:Rectangle"<<endl;
cout<<"E/e:exit"<<endl;
cout<<"Please enter your selection"<<endl
cin>>ch;
switch (ch)
{
case 'c':
cout<<"you selected circle"<<endl;
cout<<"Please enter the radius"<<endl;
cin>>a;
area=3.14*a*a;
cout<<"the area of circle with radius"<<area;
break;
case 't':
cout<<"You selected traingle"<<endl;
cout<<"Please select base and height "<<endl;
cin>>a;
cin>>j;
area=a*j;
cout<<"the area of the traingle is"<<area;
break;
case 'P':
cout<<"you have selected Paralleolgram"<<endl;
cout<<"Please enter the base and height"<<endl;
cin>>a;
cin>>h;
area=a * h;
cout<<"Area of the given parralelogram is"<<area
break;
case 'R':
cout<<"Enter the length and width"<<endl;
cin>>a;
cin>>k;
area=0.5*a*k;
break;
case 'e':
cout<<"Program terminates : Good bye"<<endl;
break;
default:
cout<<"You entered invalid selection";
}
getch();
}
Please use C++ and output have to look like that Create a menu driven C++ program...
Menu-driven programs will display the menu options to the user and then prompt them for a menu choice. This program will display the following menu in the following format: Calculator Options: Calculate the area of a circle Calculate the area of a rectangle Calculate the area of a triangle Calculate the area of a trapezoid Calculate the area of a sphere Exit Enter your choice (1-6) Once the user enters a choice for the menu, the program should use a...
Create a menu-driven program (using the switch) that finds and displays areas of 3 different objects. The menu should have the following 4 choices: 1 -- rectangle 2 -- circle 3 -- triangle 4 -- quit If the user selects choice 1, the program should find the area of a rectangle. rectangle area = length * width If the user selects choice 2, the program should find the area of a circle. circle area = PI * radius * radius...
Geometric calclator use python to do this program. Write a program that displays the following menu: 1. Calculate the area of circle 2. calculate the area of rectangle 3. calculate the area of triangle 4. Quit Enter your choice (1-4). if the user enters 1, your program should ask for the radius of the circle and then display its area. Use the formula to calculate the circle's area: Area = pi*r^2 Use 3.14149 for Pi and the radius of the...
Design program so that it correctly meets the program specifications given below. Specifications: Create a menu-driven program that finds and displays areas of 3 different objects. The menu should have the following 4 choices: 1 -- square 2 -- circle 3 -- right triangle 4 -- quit If the user selects choice 1, the program should find the area of a square. If the user selects choice 2, the program should find the area of a circle. If the user...
Java only please Write a program that displays the following menu: Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Triangle 3. Calculate the Area of a Rectangle 4. Quit Enter your choice (1-4): If the user enters 1, the program should ask for the radius of the circle and then display its area. Use the formula: area = ∏r2 Use 3.14159 for ∏. If the user enters 2 the program should ask for...
Create a menu-driven Java application that solves several math problems. The user will select a number, and the program will respond with a necessary data. When the user enters option 5, the program will end. Below is sample output for the program: What would you like me to do? 1. Calculate area of a circle? 2. Convert Fahrenheit temperature to Celsius? 3. Convert miles to kilometer? 4. Convert inches to centimeter? 5. Exit program? Please enter your option: 1 Enter...
Q2: Write a menu-driven C program using switch-case to calculate the following: 1. Area of circle 2. Area of square 3. Area of rectangle The program should use the following functions properly: void displayMenu() //a function that will display the menu options to the user int getChoice() //a function that will input the user choice and returns it float calculate(int choice) //a function that reads the required inputs based on the user choice, and returns the area of the shape...
Using C++, Write a program that will provide the user a menu from which the user may select to calculate the area of one of four geometric shapes: a circle, a rectangle, a triangle, and a trapezoid. You should use the most appropriate SWITCH block for this program. The user will input all data needed to calculate the area. The program should output all data input by the user, the calculated area, and the geometric shape selected. Run this program...
(PYTHON) Write a program that displays the following menu:. , Write Algorithm for Code Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle 4. Quit Enter your choice (1 - 4): If the user enters 1, the program should ask for the radius of the circle and then display its area. If the user enters 2, the program should ask for the length and width of...
Use Python 3 Create a program that uses Turtle to draw shapes. Show the following menu: Enter Circle Enter Rectangle Remove Shape Draw Shapes Exit Circles – User inputs position, radius, and color. The position is the CENTER of the circle Rectangles – User inputs position, height, width, color. The position is the lower left-hand corner Colors – Allow red, yellow, blue, and green only Remove – Show the number of items in the list and let the user enter...