Question: JAVA java Question 5 (26 marks) A family of classes are being designed to store information about ships. There will be an abstract class called

JAVA java JAVA java Question 5 (26 marks) A family of classes are being

Question 5 (26 marks) A family of classes are being designed to store information about ships. There will be an abstract class called Ship, and an Interface called IShip. Ship will have all the expected constructors, accessors and mutators to support the fol- lowing class fields serialNum: a real number, year: an integer; engine: an Engine object. IShip will have one abstract method: destinationCheck: given an integer import (dist) calculate the time (a real number) it would take to move that distance. You may assume for this question that the abstract class and the interface have been completed and are available for your use. Design a class called StarShip. This class inherits from Ship, implements Iship and is responsible for the following information: lightSpeed: a integer number between 2 and 10 (inclusive) specifying how close to light speed the ship can travel; Two StarShip objects are considered equal if and only if ALL of their classfields are the same. The destination check for StarShip is determined by the following formula: distance time = 7 lightSpeed - 100 You are required to write the following methods: . Alternate constructor, Copy constructor (but not clone), Accessors, equals, and All inherited abstract methods Your design must include all of the good features that have been discussed in the lec- tures and worksheet exercises

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!