Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

You will be creating a class called Seating. This class should be defined in a file named “Seating.java

You will be creating a class called Seating. This class should be defined in a file named “Seating.java”. The

class Seating will contain 2 dimensional array called “seating” of Employee objects as its instance variable. The class Seating must include the following constructor and methods. (If your class does not contain any of the following methods, points will be deducted.)

Method Description of the Method
public Seating(int rowNum, int columnNum) It instantiates a two dimensional array of the size “rowNum” by “columnNum” specified by the parameters. Then it initializes each employee element of this array using the constructor of the class Employee without any parameter. So each employee will have default values for its instance variables.
private Employee getEmployeeAt(int row, int col) It returns an employee at the indexes row and col (specified by the parameters of this method) of the array “seating”.
public boolean assignAt(int row, int col, Employee tempEmployee) The method attempts to assign the “tempEmployee” to the seat at “row” and “col” (specified by the parameters of this method). If the seat has a default employee, i.e., an employee with the name “???”, then we can assign the new employee “tempEmployee” to that seat and the method returns true. Otherwise, this seat is considered to be taken by someone else; the method does not assign the employee and returns false.
public boolean checkBoundaries(int row, int col) The method checks if the parameters row and col are valid. If at least one of the parameters “row” or “col” is less than 0 or larger than the last index of the array (note that the size of rows and columns can be different), then it return false. Otherwise it returns true.
public String toString( ) Returns a String containing information of the “seating”. It should show the list of employees assigned to the seating using the toString method of the class Employee (it shows first name initial of each employee) and the following format: The current seating G. H. ?. C. ?. B. ?. ?. ?. Please see the sample output listed below.

After compiling Employee.java, Seating.java, and Assignment8.java files, you need to execute Assignment8 class.

Here is sample output; user input is in Bold.

Please enter a number of rows for a seating chart.

3

Please enter a number of columns for a seating chart.

3

Please enter a file name

employeeData.txt

An employee information is read from a file.

George Bush:45000:6

Please enter a row number for the seat to be assigned.

0

Please enter a column number for the seat to be assigned.

0

The seat at row 0 and column 0 is assigned to George Bush

The current seating

——————–

G. ?. ?.

?. ?. ?.

?. ?. ?.

An employee information is read from a file.

Bill Clinton:50000:6

Please enter a row number for the seat to be assigned.

1

Please enter a column number for the seat to be assigned.

2

The seat at row 1 and column 2 is assigned to Bill Clinton

The current seating

——————–

G. ?. ?.

?. ?. B.

?. ?. ?.

An employee information is read from a file.

Hilary Clinton:60000:1

Please enter a row number for the seat to be assigned.

0

Please enter a column number for the seat to be assigned.

1

The seat at row 0 and column 1 is assigned to Hilary Clinton

The current seating

——————–

G. H. ?.

?. ?. B.

?. ?. ?.

An employee information is read from a file.

Charlie Brown:34000:4

Please enter a row number for the seat to be assigned.

1

Please enter a column number for the seat to be assigned.

0

The seat at row 1 and column 0 is assigned to Charlie Brown

The current seating

——————–

G. H. ?.

C. ?. B.

?. ?. ?.

An employee information is read from a file.

David Beckham:1000000:14

Please enter a row number for the seat to be assigned.

1

Please enter a column number for the seat to be assigned.

2

The seat is taken.

An employee information is read from a file.

David Johnson:450000:16

Please enter a row number for the seat to be assigned.

2

Please enter a column number for the seat to be assigned.

2

The seat at row 2 and column 2 is assigned to David Johnson

The current seating

——————–

G. H. ?.

C. ?. B.

?. ?. D.

An employee information is read from a file.

Snow White:900000:43

Please enter a row number for the seat to be assigned.

0

Please enter a column number for the seat to be assigned.

2

The seat at row 0 and column 2 is assigned to Snow White

The current seating

——————–

G. H. S.

C. ?. B.

?. ?. D.

An employee information is read from a file.

Elvis Presley:1200000:2

Please enter a row number for the seat to be assigned.

3

Please enter a column number for the seat to be assigned.

4

row or column number is not valid.

A customer Elvis Presley is not assigned a seat.

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"