$19.60
In this program, you will be creating an application to hold various types of space craft.
Name your project FirstnameLastnameAssignmentNumber
A space craft is a generic term for an object in space which holds people. The SpaceCraft class needs to be a public abstract class. People sit in seats. Your SpaceCraft class should have the fields:
A space station doesn't move in space. It houses people. The SpaceStation class needs to extend SpaceCraft. It should have the following fields:
A space shuttle moves people around in space. A space shuttle has engines. The SpaceShuttle class needs to extend SpaceCraft. It should have the following fields:
Your main method should begin with an empty ArrayList of SpaceCraft objects.
Write a menu based application which does the following:
In this example run, I add Deep Space Station K-12 and the Enterprise to my space craft organizer. Your organizer should behave like this for full credit.
Welcome to James Church's Space Craft Organizer.
1. Add a new space station.
2. Add a new space shuttle.
3. Display count of all space craft.
4. Display count of number of seats.
5. Display description of all space craft.
6. Quit.
Enter an option from 1 to 6: 1
Enter a new Space Station.
Enter the name: K-12
Enter the number of seats: 1000
Enter the number of ports: 100
1. Add a new space station.
2. Add a new space shuttle.
3. Display count of all space craft.
4. Display count of number of seats.
5. Display description of all space craft.
6. Quit.
Enter an option from 1 to 6: 2
Enter a new Space Shuttle.
Enter the name: Enterprise
Enter the number of seats: 500
Enter the number of engines: 2
1. Add a new space station.
2. Add a new space shuttle.
3. Display count of all space craft.
4. Display count of number of seats.
5. Display description of all space craft.
6. Quit.
Enter an option from 1 to 6: 3
There are 2 space craft.
1. Add a new space station.
2. Add a new space shuttle.
3. Display count of all space craft.
4. Display count of number of seats.
5. Display description of all space craft.
6. Quit.
Enter an option from 1 to 6: 4
There are 1500 seats across all space craft.
1. Add a new space station.
2. Add a new space shuttle.
3. Display count of all space craft.
4. Display count of number of seats.
5. Display description of all space craft.
6. Quit.
Enter an option from 1 to 6: 5
All Space Craft.
Space Station K-12 has 100 ports.
Space Shuttle Enterprise has 2 engines.
1. Add a new space station.
2. Add a new space shuttle.
3. Display count of all space craft.
4. Display count of number of seats.
5. Display description of all space craft.
6. Quit.
Enter an option from 1 to 6: 6
Your source code must include the following documentation:
To turn in your application, find the folder containing your entire project (not the folder with the "java" file), zip it up, and turn it in.