Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Note: Provide a copy of the code and screen shot for the output in the solutions with your name and ID. 3. Write a C#
Note: Provide a copy of the code and screen shot for the output in the solutions with your name and ID. 3. Write a C# application that implements a class 'shapes" with the following members. a. Five data members 'p', 'h' of integer data type and 'ar', 'cir', and 'vol' of double data type. b. Five public methods, readValues(), areal), circumference(), volume() and dispResult() i. readValues () - to accept the values of 'r' and 'h' from the keyboard. ii. area () - to calculate the area of the circle. iii. circumference() to calculate the circumference of a circle. iv. volume() - to calculate the volume of a cylinder. v. disResult()- to display the area and circumference of the circle and volume of the cylinder. In the Main method, create an object "obj" of the 'shapes class, and calculate the area, circumference and volume using the above methods. Explain the program. [15 Marks] (Area of circle = rr^2, circumference of circle = 2tr, Volume of cylinder = rr^2h) Sample 1/0 Enter radius: 5 Enter height: 7 Area of circle=78.5 Circumference of circle= 31.4 Volume of cylinder= 549.5
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