Write a program that reads customers information from file

Assignment Help JAVA Programming
Reference no: EM131094157

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.

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.

We will be using the following files. These files 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. ?.?.

Reference no: EM131094157

Questions Cloud

Do you agree that intelligence is based on ones hereditary : According to the Fulcher and Scott (2011) article, do you agree that intelligence is based on one's hereditary (nature) or one' environment (nurture)?
Describe migration and social life of the ancient u.s people : Give an explanation of why its important to study history and describe the migration and social life of the ancient U.S people.
Transmission systems : Write a report on the topic "Transmission Systems"
Explain what spillovers are generated from the subsidy : Describe the subsidy program and explain what spillovers are generated from the subsidy. Explain how both consumer and producer surplus will be affected by the subsidy. Will they increase or decrease?
Write a program that reads customers information from file : 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).
Cardiac catheterization reveals : He was treated via a 3-day stay in the hospital and sent home with a drug regime and since then has been seen in the ER two times and is now hospitalized again with shortness of breath, pedal edema, and weight gain.
What is monopolistic about monopolistic competition : What is "monopolistic" about monopolistic competition? What is "competitive" about a monopolistically competitive market? Please explain using revenue and cost curves.
Cell phone batteries claims their new battery : A company that produces cell phone batteries claims their new battery last more than 30 hours.
Probability that the fisher chosen from clearwater : Suppose that one fisher from each park is chosen at random. What is the probability that the fisher chosen from Clearwater had a license and the fisher chosen from Mountain View did not have a license?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write the complete code for a public java class

Write the complete code for a public Java class called Change Machine that can hold nickels, dimes and quarters. Include a private instance variable to hold each type of coin that the machine hols.

  What is the purpose of using javascript on a website what

what is the purpose of using javascript on a website? what is a specific example of a javascript application that will

  How threads are used to implement currency in java

Describe the concept of concurrency and how threads are used to implement currency in Java

  How to compile and debug your work

You will be writing a Java program to allow people to play the 24-puzzle (the obvious variant where the frame is 5x5) puzzle) in a text based context. My goal is that you recall how to enter programs (probably using jGrasp), how to write a small/s..

  Design a class that keeps track of a students food purchases

Design a class that keeps track of a student's food purchases at the campus cafeteria. A meal card is assigned to an individual student. When a meal card is first issued

  The ai player will not be asking

The AI player will not be asking the user for any input. This means that placeShips() and fire() should not ask the user for locations. The AI player should choose locations of ships and automatically place them

  Create a testing java program

Please create a testing Java program to use this RandomSeq class to create a random DNA sequence and then print it out in a formatted fashion with a specified length for each line.

  Method that reflects overloading

Example of a method that reflects overloading, and one that reflects polymorphism

  Create a structure named dog with a string field

Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name.

  Design and construct a computer program

Design and construct a computer program in one of the approved languages (C, C++, Java, Pascal, etc.) that will illustrate the use of a third-order explicit Runge-Kutta method of your own design.

  Tasks for an array of integers

Write array methods that carry out the subsequent tasks for an array of integers by completing the ArrayMethods class below. Test each method.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

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