Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Phase 1 : Write a class representing a 2 D point. Have the class consist of two fields representing it's coordinate, ideally x and y

Phase 1:
Write a class representing a 2D point.
Have the class consist of two fields representing it's coordinate, ideally x and y.
Let the fields (data members) be public, but make sure that they don't fall victims to immutability so set the fields to be constant.
Write a method (function members) that finds the distance from one point to the other.
Write a method that finds the slope given another point.
Phase 2
Using only instances of the point class, write a class representing a circle object. Let hte fields be public, but make sure that thy don't fall victims to immutability so set the fields to be constant. Provide an area and a perimeter method (function member)
Phase 3
Using only instances of the circle class write a sphere class. Let the fields (data members) be public, but make sure that they don't fall victims to imuutability so set the fields to be constant. Provide a volume and surface area method (function member)

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

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

Identify the four reasons for project termination.

Answered: 1 week ago