Question
I just need some help with an UML for this program. #include #include #include #include using namespace std; // Declare pi const double PI =
I just need some help with an UML for this program.
#include
void Area::Option_1() { // Prompt user to enter a radius cout << "Enter radius: "; double radius; cin >> radius; // If the radius is less than 0 display a message if ( radius < 0 ) { cout << "Invalid radius; " << endl; } // If the radius is greater than 0 calculate the area if ( radius >= 0 ) { double area = pow (radius, 2 ) * PI; cout << "Area of the circle is " << area << endl; } } void Area::Option_2() { // Promt user to enter a side cout << "Enter side: "; // Declare side int side; cin >> side; // If the side is less than 0 display a message if ( side < 0 ) { cout << "Invalid side " << endl; } // If the side is greater than 0 calculate the area if ( side > 0) { cout << "Area of the square is " << side * side<< endl; } } void Area::Option_3() { // // Promt user to enter length and width cout << "Enter length and width: "; // Declare length and width double length, width ; cin >> length >> width; // If the length is less than 0 display a message if ( length < 0 ) { cout << "Invalid length " << endl; } // If the width is less than 0 display a message if ( width < 0 ) { cout << "Invalid width " << endl; } // If the length and width are greater than 0 calculate the area if ( length >= 0 && width >= 0 ) { double area = length * width; cout << "Area of the rectangle is " << area << endl; } } int main() { while(true) { // Menu option system("cls"); Area s; //Object of Area cout << endl; cout << "
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started