Question: Can someone please show the java code that fits this problem description using loops and not switch? Information: The sub - classes and their fields

Can someone please show the java code that fits this problem description using loops and not switch?
Information:
The sub-classes and their fields are including all setters and getters
Yacht: private int numStateRooms;
int poolSize;
int numDecks;
int power;
int engineSize;
CruiseShip: int numOfExecStateRooms;
int numOfDoubleBunkRooms;
int numOfQuadBunkRooms;
CaargoShip: int maxCargo;
int refrigiratedStorage;
The super-class is Ship its fields are String name;
String nation;
int year;
int length;
int draft;
int beam;
Sub-Classes have already been created.
Problem description:
Create a driver class called FlotillaDriver that is
required to do specific tasks.
Open the text file called flotilla.csv and load all ship using
the appropriate subclass into an ArrayList dedicated to the
super class Ship.
Instantiate the proper sub ship object to add to the list. The initial list will only need the basic ship information
but when creating the displays when one of the buttons is
clicked, you must provide the additional information of the
individual sub ship.
Purpose: load all information from the
unique subclasses into a list of the superclass.

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!