Question
Please use C++ and output have to look like that
Create a menu driven C++ program with functions. There must be four functions, calculating the size of area of circle, rectangle, triangle, and parallelogram. You are required to create those four functions and invoke them from the main program in order to reccive any credit. Please Submit: . A flowchart of your program with equations and expected results. 4 points) 2. Printout of your C++program with a heading comment, also appropriate spacing points) (2 points) and indentation in the program body 3. Copy of a screenshot after your program is execut ed. ELEN 1301-02 Programming Assignment #8 Name Student ID : Your student ID Due date Purpose of the program : Your name : October 20, 2016 Calculate the size of areas of different shapes SectionShow a menu and receive a selection from a user Section 2 Enter real number (s) for the measurement Section 3: Calculate the size of the area, based on the selection Display the answer Section4 Repeat Section 1 through Section 3 until user specifies Exit // Write your own progr㏂ Output example: Welcome to Area calculator Please select a function to be performed: C/c: circle T/t: triangle P/p: parallelogram R/r: rectangle E/e: Exit. Please enter your selection: C You selected circle Please enter raduis 2.5 The area of a circle with radius 2.5-19.635 Please select a function to be performed: C/c: circle T/t: triangle
Please use C++ and output have to look like that
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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();

}Star Enter You ch Enter radius@f | atere a 罚 |었訟 and height rea Area int Area rin

Add a comment
Know the answer?
Add Answer to:
Please use C++ and output have to look like that Create a menu driven C++ program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Menu-driven programs will display the menu options to the user and then prompt them for a...

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

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

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

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

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

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

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

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

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

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

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT