Question: Write a class shape. It should have some suitable functions e.g., area, perimeter, etc. Write classes circle, triangle, and rectangle and inherit from shape class.

Write a class shape. It should have some suitable functions e.g., area, perimeter, etc. Write classes circle, triangle, and rectangle and inherit from shape class. Write individual functions in them for area, perimeter, and at least one more common function which you can think of. Write a program and create objects of child classes. Calculate area, perimeter/circumference etc. Take the values of variables from the user. Declare suitable data members as well. Think which data members do you need and in which class should you declare them.

Class Circle ComputeArea0; Circumference; Class Triangle ComputeAreaO; Perimeter( Area:IIr r-radius II=3.14 Circumfernce:21Ir

Class Circle ComputeArea0; Circumference; Class Triangle ComputeAreaO; Perimeter( Area:IIr r-radius II=3.14 Circumfernce:21Ir Area:0.5 x base x height P=sidel+side2+side3 Create the UML diagram of your class. Mention class, functions, and variable names in it.

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution using System using SystemCollectionsGeneric using SystemLinq using SystemText using SystemT... View full answer

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 Programming Questions!