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 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
Step: 1
Solution using System using SystemCollectionsGeneric using SystemLinq using SystemText using SystemT...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