Program that reads customers information from a file

Assignment Help JAVA Programming
Reference no: EM13776971

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 instance variable.

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 di erent), 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. ?.?.

Reference no: EM13776971

Questions Cloud

Relationship between attention and cognition : How do you define the concept of attention? Can attention be consciously allocated to tasks? Why or why not?
Analyze the alternatives presented and make a recommendation : While you were visiting London, you purchased a Jaguar for £35,000, payable in three months. You have enough cash at your bank in New York City, which pays 0.35 percent interest per month, compounding monthly, to pay for the car.
Analyze the given scene from the movie you have got mail : Analyze this scene from the movie "You've Got Mail." It takes place in an elevator where Joe Fox (the Tom Hanks character) and his girlfriend (Parker Posey) and two other people get stuck in an elevator
Assignment on java applets and activex controls : Go online and search for information about security threats posed by Java applets and ActiveX controls. Note that most of these programs are small in size and downloaded onto computers over the Internet.
Program that reads customers information from a file : 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.
Concepts of rogerian therapy : Similar to Freud, Carl Rogers developed his theory from his extensive work with his patients. However, unlike Freud, he believed that people are typically healthy; being mentally healthy is the normal state. Although there are unhealthy people, th..
Brief history of the war on drugs : In a 2-3 page paper students will write an essay outlining a brief history of the "War on Drugs."in addition, students should reflect whether it is possible to win the war on drugs to include evidence of its successful ness or failures
Social stratification related issues : Examine how different your life would be if you lived in a caste-system instead of a class-system.
Does your country have a fixed, floating, or managed exchang : Answer the following questions: Does you country have a fixed, floating, or managed exchange? Does your country control its own currency (is it and issuer or just a user of currency)? How exchange rate of the changed in the past three months? In the ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Finding java code error

Indicate in the given code segment if an error occurs. If so, point to whether it is syntax, runtime or logic and how you would fix it.

  Take a position on whether or not an object-oriented

take a position on whether or not an object-oriented approach can be used to develop any type of system. provide two

  Write an application named us insurance

Write an application named UseInsurance that uses an abstract Insurance class and Health and Life subclasses to display different types of insurance policies and the cost per month.

  Design a class named large integers

Design a class named largeIntegers such that an object of this class can store an integer of any number of digits.

  Personalize the time zone application of section 24.3

Personalize the time zone application of Section 24.3. Prompt the user to log in and specify a city to be stored in a profile. The next time the user logs in, the time of their favorite city is displayed automatically.

  Method called wordlengths that accepts a scanner

Write a method called wordLengths that accepts a Scanner representing an input file as its argument. Your method should read from the given file.

  Implement the lexical and syntactic analysis

Implement the lexical and syntactic analysis of Minifun programming language.

  Question superclass and provide a different implementa

Add a method addText to the Question superclass and provide a different implementa- tion of ChoiceQuestion that calls addText rather than storing an array list of choices.

  Make an explicit statement of the invariant of the set class

Write a new container class called ser, which is similar to a bag, except that a set can contain only one copy of any given item, You will need to change the interface a bit. For example, instead of the bag's count function, you'll want a constant..

  How many states are there and draw and label the states

How many states are there and draw and label the states (with variable values) and transitions (with method names). Notice that all of the methods are total.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Write a java class that reads through a text file

You will write a Java class that reads through a text file of drawing commands and draws the appropriate shapes onto JFrames

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd