Coded in java


Coded in java program


question 1: write a class encapsulating a board game, which inherits from Game. A board game has the following additional attributes: the number of players and whether the game end and in a tie. Code the constructor and toString method of the new class. You also need to include client class to test your code.

question2: Write a superclass encapsulating a circle; this class has one attribute representing the radius of circle. It has method returning the perimeter and the area of circle. This class has a subclass, encapsulating a cylinder. A cylinder has a circle its base, and another attribute, its length; it has two method, calculating and returning its area and volume. You also need to include a client class to test these two classes.

question 3: write an abstract superclass encapsulating a vehicle: A vehicle has two attributes: its owner's name and its number of wheels. This class has two non-abstract subclasses: one encapsulating a bicycle, and the other encapsulating a motorized vehicle. A motorized vehicle has the following additional attributes: its engine volume displacement, in liters; and a method computing and returning a measure of horsepower --the number of liters times the number of wheels. You also need to include a client class to test these two classes.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Coded in java
Reference No:- TGS0783352

Expected delivery within 24 Hours