Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Topics

2-Dimensional Arrays
Classes
Searching
Reading from a file

Coding Guidelines:
• Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc).
• Keep identifiers to a reasonably short length.
• User upper case for constants. Use title case (first letter is upper case) for classes. Use lower case with uppercase word separators for all other identifiers (variables, methods, objects).
• Use tabs or spaces to indent code within blocks (code surrounded by braces). This includes classes, methods, and code associated with ifs, switches and loops. Be consistent with the number of spaces or tabs that you use to indent.
• Use white space to make your program more readable.

Part #1: Written Exercises (0 pts)
None.

Part #2 - Programming (20 pts)
Write a program that reads customers' information from a file, and creates a movie theatre seating with a number of rows and columns specified by a user. Then it will attempt to assign each customer to a seat in a movie theatre.

You will be creating a class called MovieSeating. This class should be defined in a file named MovieSeating.java. The class MovieSeating will contain a 2 dimensional array called seating of Customer objects as its in- stance variable.

We will be using the following files. These ftles are complete. Download the following files (available on Blackboard) and use them for this assignment (do not change the content of the following files).
• Assignment7.java
• Customer.java
• CustomerData.java

The last file is an input file (text file) that will be read from the Assignment7 class. Save all of the files in the same folder.

The class MovieSeating must include the following constructor and methods. (If your class does not contain any of the following methods, points will be deducted.)

• public MovieSeating(int rowNum, int columnNum) - It instantiates a two dimensional array of the size rowNum by columnNum specified by the parameters. Then it initializes each customer element of this array using the constructor of the class Customer without any parameter. So each customer will have default values for its instance variables.
• private Customer getCustomerAt(int row, int col) - It returns a customer at the indexes row
and col (specified by the parameters of this method) of the array seating.
• public boolean assignCustomerAt(int row, int col, Customer tempCustomer) - The method attempts to assign tempCustomer to the seat at row and col (specified by the parameters of this method). If the seat has a default customer, i.e., a customer with the last name "???" and the first name "???", then we can assign the new customer tempCustomer 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 customer 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 returns false. Otherwise it returns true.
• public String toString() - Returns a String containing information of the seating. It should show the list of customers assigned to the seating using the toString method of the class Customer (it shows initials of each customer) and the following format:

The current seating
--------------------
C.B. ?.?. E.P.
?.?. ?.?. G.B.
B.C. H.C. ?.?.

Attachment:- Java Assignment.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M92399341
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As