Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create C++ code, using the psuedocode: 1. Declare a global constant named PI equal to 3.141592; 2. Declare variables named base, height , radiusa ,

Create C++ code, using the psuedocode:

1. Declare a global constant named PI equal to 3.141592; 2. Declare variables named base, height, radiusa, radiusb, rec_area, and elli_area that hold real numbers. 3. Print on the screen For the rectangle 4. Call void function getData(base, height) that gets two lengths from the keyboard and returns them to main( ). 5. Print on the screen For the ellipse 6. Call void function getData(radiusa, radiusb) that gets two lengths from the keyboard and returns them to main( ). 7. Calculate the area of the rectangle and store the result in rec_area. 8. Calculate the area of the ellipse and store the result in elli_area. 9. Call void function printData(rec_area, elli_area) that receives the two areas and prints on the screen the message:

"The area of the rectangle is ", rec_area "The area of the ellipse is ", elli_area

Function getData(rpar1, rpar2 ) must: 1. Prompt the user to "Please enter two lengths: "

2. Get both values from the keyboard and store them in rpar1 and rpar2. Note: rpar1 and rpar2 are reference parameters.

Function printData(vpar1, vpar2) must: 1. Format the output to display the numbers in fixed format with one decimal digit.

2. Print the message on the screen.

Note: vpar1 and vpar2 are value parameters.

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_2

Step: 3

blur-text-image_3

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

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

Define cardiac cycle, and follow the events of one cycle.

Answered: 1 week ago

Question

What are the organizations task goals on this issue?

Answered: 1 week ago