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

  How to count number of objects (instances) created

How to count number of objects (instances) Created, use java code and please be descriptive

  Part 1product maintenanceyoull create a series of pages

part 1product maintenanceyoull create a series of pages that allow you to add update or delete a product thats

  Write a java program that reads a five-line address

Write a Java program that reads a five-line address from an input file and produces an output file with the address repeated 50 times in three columns.

  Write the code and output result1 real cash register can

write the code and output result.1. real cash register can handle both bills and coins. design a single class that

  Create an interface called transcripts

You are going to create an interface called Transcripts with 2 methods: getGPA() and getTotalCredits(). Implement these methods in the Student class you created for Assignment

  Develop game using the concepts of cohesion

Develop any game of your choice using the concepts of Cohesion, Coupling and RDD, i.e., responsibility-driven design.

  Write java statements to create a collection of integers

Write Java statements to create a collection of integers, and to initialize each element of the collection to -1. Then, using for each statement to print the value of each element.

  Give an example of an exception

A. Give an example of an exception that could be generated outside your code but caught within your code

  Design a method in a stack implementation

Design a method in a Stack implementation that allows the user to insert a new member to the "bottom" of a stack.

  Assessment taskyour task is to develop a java application

assessment taskyour task is to develop a java application that allows the user to read travel booking data from a text

  That uses a library database of books

Write a Java program that uses a library database of books and patron data, as described in Exercise R22.2. Patrons should be able to check out and return books

  Sample papaer hello can you please help me to solve this

hello can you please help me to solve this sample paper and there is not submit date as this is for me but still i want

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