Question: Question text Write the necessary functions for the following program. Do not change main, just write the functions. Area of a rectangle is length *

Question text Write the necessary functions for the following program. Do not change main, just write the functions. Area of a rectangle is length * width. Area of a square is side * side; getNumber returns a positive integer (validates as needed) #include using namespace std; int main() { cout << "Enter length and width of a rectangle: "; int length = getNumber(); int width = getNumber(); cout << "Its area is " << area(length, width) << endl; cout << "Enter the side of a square "; int side = getNumber(); cout << "Its area is " << area(side) << endl; return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!