5/08/2016

BCS2233: Inheritance Exercise


Create a base class named Point consisting of x and y data members representing point coordinates. From this class, derive a class named Sphere with another data member named radius. For this derived class, the x and y data members represent a sphere’s centre coordinates. The member method of the Point class should consist of a constructor that set the value for x and y to 0, an volume() method that return 0, and distance() method that returns the distance between two points, (x1,y1) and (x2,y2), where



Additionally, the derived class should has an overided method named volume() that return’s a Sphere volume

Volume = (4/3) × 3.14 × radius³


Draw UML diagram for the class Point and class Sphere.

No comments:

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...