/* * To change this license header, choose License Headers

SOLUTION AT Australian Expert Writers

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package EddieExamples;import java.awt.Container;import java.awt.FlowLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;//import javax.swing.JFrame;import javax.swing.JTextField;import javax.swing.JApplet;import javax.swing.JOptionPane;/** * * @author Ramon */public class Assign7ex extends JApplet implements ActionListener {    boolean econfull = false;    boolean firstfull = false;    boolean[] seats;    //    JButton firstBtn;    JButton econBtn;    JTextField input;    boolean isFirst = false;    int seated = 0;               @Override   public void init(){  // sets up window for display – JLabel and JTextField        for (int t = 0; t == 11; t++) {            seats[t] = false;        }            // sets up container window      Container c = getContentPane();      c.setLayout( new FlowLayout() );           // adds JLabel      firstBtn = new JButton();      firstBtn.setText(‘First Class’);      add(firstBtn);      firstBtn.addActionListener(this);           econBtn = new JButton();      econBtn.setText(‘Economy’);      add(econBtn);      econBtn.addActionListener(this);           // adds JTextField and connects it to actionListener      input = new JTextField(25);      add(input);   }    @Override    public void actionPerformed(ActionEvent e) {    Assign7ex assigner = new Assign7ex();        if (e.getSource() == firstBtn) {            input.setText(‘1st button clicked’);            isFirst = true;            seated = reserve(isFirst);  // ERROR HAPPENS HERE            System.out.println(‘I am here!’);            switch (seated) {            case 1: case 2: case 3: case 4: case 5:                input.setText(‘Boarding Pass: Seat ‘ + seated + ‘ First Class’);                break;            case 6: case 7: case 8: case 9: case 10:                input.setText(‘Boarding Pass: Seat ‘ + seated + ‘ Economy Class’);                break;        }    } else if (e.getSource() == econBtn) {            input.setText(‘2nd button clicked’);            isFirst = false;            System.out.println(‘I am big!’);            assigner.seated = assigner.reserve(isFirst); // ERROR HAPPENS HERE    }    //seated = reserve(isFirst);        switch (seated) {            case 1: case 2: case 3: case 4: case 5:                input.setText(‘Boarding Pass: Seat ‘ + seated + ‘ First Class’);                break;            case 6: case 7: case 8: case 9: case 10:                input.setText(‘Boarding Pass: Seat ‘ + seated + ‘ Economy Class’);                break;        }        if (econfull == true && firstfull == true) {            seated = -2;        }    System.out.println(‘Airplane is Full! – Thank you for playing Airplane Seating!’);    }     public int reserve(boolean isFirstClass) {               boolean done = false;        int seat = 0;               if (econfull == true && firstfull == true) {            return -2;        }        if (isFirstClass == true && firstfull != true) {            for (int i = 1; i
/* * To change this license header, choose License Headers first appeared on Template.

Order from Australian Expert Writers
Best Australian Academic Writers

QUALITY: 100% ORIGINAL PAPERNO PLAGIARISM – CUSTOM PAPER