Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need ASAP oAssme that all required mathematical functions and constants are provided and the following class Circle is provided: 1 C++ class Circle ( private:

Need ASAP image text in transcribed
oAssme that all required mathematical functions and constants are provided and the following class Circle is provided: 1 C++ class Circle ( private: // Java class Circle t private double r; public Circle(double radius) double r (rradius; t return r; ( return Math.PI r *r public: Circle(double radius) public double getRadius() : r(radius) ) double get_radius() const public double area() return r double area() const ( return M PIr r Task Choose any oOP language you prefer and write the class for the circular cone that 1. The name of the class is Cone. 2. The encapsulated state of the class is defined satisfies the following requirements: 1 Slant height h Height r Radius either i.by the height (h) and the radius (n: or ii.by the height (h) and the instance of the gven class Circle as a base (b). L. (Choose one, however, the option 2.ii. will be evaluated higher.) 3. Ensure that the only way to construct the instance of the class Cone i providing the values of its height and radius 4. Once the object of the Cone has been constructed it should not be allowed to change the values of its dimensions. The class should, however functions to retrieve the current values of height and radius The class behavior should be implemented by functions that return the volume (rr2h), base area (rr2), lateral area (rrnF+R) and a total surface area of the cone object. (For calculating the total surface area try to reuse the functions for the base and lateral surface areas calculation.) 5. NOTE1: Functions in the 5h item must only calculate and return the result. They should not modify (or 'print) this value NOTEz: If you selected option 2 i, then you should try to reuse already existing behavion of the class Circle (via member variable b) tinues on the right.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

Describe the two dimensions Hofstede added later.

Answered: 1 week ago

Question

Explain how psychologists use traits to describe personality.

Answered: 1 week ago

Question

explain the concept of strategy formulation

Answered: 1 week ago