Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to write a simple Java program using Eclipse Indigo to create a base airp

ID: 3640648 • Letter: I

Question

I need to write a simple Java program using Eclipse Indigo to create a base airplane class with no defined seating arrangement, and create child classes for two different sized airplanes (ie one with 6 seats a row and one with 4 seats a row. Program should prompt users to enter their desired seats and tell them if that seat is unavailable. This should be a menu-driven program; showing the user

Explanation / Answer

My last attempt... import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Choose plane: 1: 4-seater, Otherwise: 6-seater"); int x = sc.nextInt(); Airplane plane; if (x != 1) plane = new SixSeater(); else plane = new FourSeater(); while (!plane.allSeatsTaken()) { int row, seat; plane.printSeatingPlan(); System.out.println(); System.out.print("Select your row: "); row = sc.nextInt(); System.out.print("Select your seat: "); seat = sc.nextInt(); plane.takeSeat(row, seat); } } } abstract class Airplane { private String name; protected boolean[][] seats; protected int allocatedSeats; public Airplane() { } public boolean allSeatsTaken() { return allocatedSeats >= seats.length * seats[0].length; } public String getName() { return name; } public void takeSeat(int row, int seat) { if (row >= 0 && row = 0 && seat