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

  Develop the implementation file student.cpp

Required to implement the class to develop the implementation file Student.cpp that conforms to the following specifications

  T an array using insertion sort and track the number of swap

How to sort an array using insertion sort and track teh number of swaps during the sorting

  Functional abstraction

Question 1: What are some of the benefits of modularity? Question 2: What is functional abstraction? Question 3: What is information hiding?

  What is the expected big-o running time

What is the expected Big-O running time if an ArrayList is passed. Explain your answer

  Explain where the following method invocations

Explain where the following method invocations are most likely to be found in a program for dealing with census data organized using the Model, View, Controller (MVC) design pattern. Choices are zero or more of Model, View, and Controller. Be sure to..

  1 gqueuea queue is an ordered collection of items in which

1 gqueuea queue is an ordered collection of items in which the removal of items is restricted to the fifo rst in rst

  Project socket programming - udp objectives - learn socket

project socket programming - udp objectives - learn socket programming in java udp-nbsp cement your understanding of

  Prepare a mobile android app

The app should target Android and be written in Java, unless you have obtained prior permission from your instructor to target a different platform

  Prepare an application that creates object of the classes

Write a CarbonFootPrint with only a pure virtual getCarbonFootprint method -  Have each of your classes inherit from the abstract class and implement the getCarbonFootprint method to compute an appropriate carbon footprint for that class.

  Design a single class that expresses the commonality

Design a single class that expresses the commonality of these concepts.

  The array at the index method

have an array, how do i remove an entry from the array at the index method?

  Write a java program that finds the temperature

Write a JAVA program that finds the temperature that is the same in both Celsius and Fahrenheit.

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