Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include using namespace std; void arithmetic() { int op = 0; float A = 0; float B = 0; float a,b,c,l,d,area,volume; cout>op; cout>A; cout>B;

#include #include using namespace std; void arithmetic() { int op = 0; float A = 0; float B = 0; float a,b,c,l,d,area,volume; cout>op; cout>A; cout>B; cout

{ case 1: cout

cout

void trignometric() { int op = 0; float val = 0.0; cout>op; cout>val; if(op == 1) { cout

else if(op == 2) { cout

cout

void exponential() { float base = 0.0; float eee = 0.0; cout>base; cout>eee; cout

void logarithmic() { float value = 0.0; cout>value; cout

void equilateral() {//Input the side and save it in 'a' float a,b,area; cout>a; cout>b; //calculate area and save it in 'area' area=(a*b)/2; //show the output 'area' cout

void circle() {//Input the radius and save it in 'c' float c,area; cout>c; //calculate area and save it in 'area' area=3.14*c*c; //show the output 'area' cout

void rectangle() {//Input the length and breadth and save it in 'l' and 'd' respectively float l,d,area; cout>l; cout>d; //calculate area and save it in 'area' area=l*d; //show the output 'area' cout

void vsphere() { int rad1; float volsp; cout >rad1; volsp=(4*3.14*rad1*rad1*rad1)/3; cout

void vcylinder() { int rad1,hgt; float volcy; cout >rad1; cout>hgt; volcy=(3.14*rad1*rad1*hgt); cout

void vpyramid() { int breadth; int height; float volume_of_pyramid;

// clrscr();

printf(" Program to calculate Volume of a Pyramid : ");

printf(" Enter the Breadth of Pyramid : "); scanf("%d", &breadth);

printf(" Enter the Height of Pyramid : "); scanf("%d", &height);

volume_of_pyramid = (1/3)*breadth*height;

printf(" Volume of Pyramid with Breadth as %d and Height as %d = %f",breadth,height,volume_of_pyramid); cout

}

void vcuboid() { float cbd_Length, cbd_Width, cbd_Height, cbd_sa, cbd_Volume, cbd_LSA;

cout > cbd_Length;

cout > cbd_Width;

cout > cbd_Height;

cbd_sa = 2 * (cbd_Length * cbd_Width + cbd_Length * cbd_Height + cbd_Width * cbd_Height); cbd_Volume = cbd_Length * cbd_Width * cbd_Height; cbd_LSA = 2 * cbd_Height * (cbd_Length + cbd_Width);

cout >sel; switch(sel) { case 1: arithmetic(); break; case 2: trignometric(); break; case 3: exponential(); break; case 4: logarithmic(); break; case 5: equilateral(); break; case 6: circle(); break; case 7: rectangle(); break; case 8: vsphere(); break; case 9: vcylinder(); break; case 10: vpyramid(); break; case 11: vcuboid(); break; default: cout

}cout>choice; if(choice == 'n') { break; } } return 0; }

image text in transcribed

Explain the flowchart above. (10 marks)

sel=0 Start If choice='y choice='y false true read sel read choice stop switch sel case 1 arithmetic case 2 trigonometrica) case 3 exponential() case 4 logarithmic) case 5 equilateral() case 6 circle() case 7 rectangle() case 8 vsphere) case 9 vcylinder() case 10 vpyramido case 11 vcuboid() default invalid

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions