Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

?Please use the UML diagram and main.cpp to complete the code below tion Point2D

ID: 3775684 • Letter: #

Question

?Please use the UML diagram and main.cpp to complete the code below

tion Point2D T X: T Int y T Point2D tion Point2D(x y T) orCode int) t getX0 T ar t getY0 T int setX(x T) void setY(y T) void public public Circle T Rectangle T width T radius T height: T Rectangle Circle() Rectangle (x y T width T, height T) Circle (x y radius T) getWidth T getRadius0 T getHeight() T setRadius newRadius T) void setWidth (newWidth T) void area0 float setHeight(newHeight T) void circumference() float area() float circumference float public Square T Square (x T y T, side T)

Explanation / Answer

#include<math.h>

#include<iostream.h>

#include<conio.h>

#pragama once

#include "Point2D.h"

#include "CustomException.h"

templete<class T>

class Rectangle {

public : void area(float r);

void area(int a,int b);

void area(float a,float b,float d);

};

void Rectangle::area(float r)

{

cout<<"Area of circle="<<(3.14*r*r)

}

void Rectangle::area(float a,float b,float c)

{

float s,ar;

s=(a+b+c)/2;

ar=sqrt(s*(s-a)*(s-b)*(s-c));

cout<<"/n area of traingle="<<ar

}

void main()

{

clrscr();

Rectangle ac;

int r,a,b,c,d;

cout<<"/n choose you option";

cout<<"/n 1.rectangle /n 2.circle /n3.traingle";

cout <<"/n enter your choice:";

cin>>c;

switch(c);

{

case 1:cout<<"/n enter breadth and length:";

cin>>a>>b;

ac.area(a,b);

break;

case 2:cout<<"/n enter radious:";

cin>>r;

ac.area(r);

break;

case 1:cout<<"/n enter three sides:";

cin>>a>>b>>d;

ac.area(a,b,d);

break;

default:count<<"invalid choice";

}

getch();

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote