Answer to Question #155833 in C++ for Ryukjak

Question #155833

In procedural programming, create a function named "getArea()" with the following parameters.

a. int length

b. int width

c. int radius

Note. Use the following variable names


1
Expert's answer
2021-01-17T08:08:27-0500
#include <iostream>
#include <cmath>
using namespace std;
void getArea (int length, int width, int radius) {
    int recta; 
    float cira;
    recta = length * width;
    cira = 3.1416 * pow(radius, 2);
    cout << "Area of Rectangle: " << recta << endl;
    cout << "Area of Circle: " << cira << endl;
}
int main () {
    int rectlength, rectwidth, cirradius;
    cout << "Legth of rectangle: ";
    cin >> rectlength;
    cout << "Width of Rectangle: ";
    cin >> rectwidth;
    cout << "Radius of Circle: ";
    cin >> cirradius;
    getArea(rectlength, rectwidth, cirradius);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS