Submission Notes You should submit a .zip file containing four Java files and three text files as follows: • SortedArrayList.java, which contains your SortedArrayList class for Task 1. • Activity.java, which contains your Activity class for Task

Submission Notes You should submit a .zip file containing four Java files and three text files as follows: • SortedArrayList.java, which contains your SortedArrayList class for Task 1. • Activity.java, which contains your Activity class for Task 2. • Customer.java, which contains your Customer class for Task 2. • MainProgram.java, which contains your MainProgram driver class for Task 2; your main() method should be in this class. • input.txt, which is the input file for your program (this can be the same as the provided input.txt file; your program should only read this file in, not change it). • clerk.txt should contain a record of the clerk’s interactions with the program displayed in the Terminal Window (both what the clerk inputs and what your program prints out; copy and paste this from the Terminal Window in IntelliJ; your program should not write to this file). • letters.txt should be the output file created by your program, which contains the letters to customers from when there are not enough tickets available. Your text files should show that you have tested your program. Aims • To gain experience in designing an interactive system of practical importance. • To reinforce your knowledge about the standard java.util.ArrayList class. • To gain experience at using the java.lang.Comparable interface, inheritance and generic classes in Java. Background Sometimes we want to keep the items in a list in sorted order, which we can achieve with a sorted list. The fundamental difference between a sorted list and an unsorted one is the “adding an item”/insertion method. Having a definition of a class for lists, we can obtain a sorted list class by altering the existing one or adding a new insertion method. Task 1 Derive a SortedArrayList class as a subclass of the java.util.ArrayList class in such a way that the items of a sorted ArrayList are sorted in ascending order. This subclass of the ArrayList class will be needed to complete Task 2 (see Additional Assumptions (2) below). You only need to provide your new insertion method in the SortedArrayList class. You do not need to consider the other methods from the ArrayList class that can modify the list. Task 2 You are asked to write a program to help a Holiday Resort ticket office clerk in their work. The Holiday Resort offers various activities to its customers. Customers can book tickets to take part in activities, but the number of tickets available for each activity is limited. Your program should read a list of available activities and a list of registered customers from a file. The content of the input file should have the following form: The first line contains an integer representing the number of available activities, and is followed by the information about the activities (two lines for every activity: one line containing the name of the activity and the second one containing the number of tickets available for this activity). The next line contains an integer representing the number of registered customers, followed by the information about the customers (one line for every customer with their first name and surname). Example file content is given below (same as the input.txt file available from Canvas), but your program should run correctly on any file in the correct format: 6 Hiking 4 Bowling 8 Cycling 10 Sailing 3 Football 22 Table Tennis 4 3 Michael Smith Anna Smith Ted Jones The program should be able to store information about activity and customers: 1. For each activity, the information required is: the name of the activity and the number of tickets left for this activity. 2. For each customer, the office should know their first name, surname and the chosen activity together with the number of tickets bought for each of the activities. A customer can hold tickets for at most three different activities at a time. We also assume that no two customers share both their first name and their surname. After the initial information has been read from the file, the clerk will work with the program interactively. The program should display a menu on the screen offering a choice of possible operations, each represented by a lower case letter: • f – to finish running the program. • a – to display on the screen information about all the activities. • c – to display on the screen information about all the customers. • t – to update the stored data when tickets are bought by one of the registered customers. • r – to update the stored data when a registered customer cancels tickets for a booking. You should implement all the above operations. Additional Assumptions 1. When f is selected, the program stops running and all the data is lost. The program could be extended to save all the data to a file, but this is not part of the project and you must not do this! 2. To store activities and customers you should use your SortedArrayList class. Activities should be sorted in the ascending (lexicographic) order of names of activities. Customers should be sorted in the ascending (lexicographic) order of their surnames. If two customers have the same surname, then their first names should decide their order. You may assume that each customer has exactly one first name and exactly one surname. 3. When tickets for an activity are ordered by a customer, your program must check whether the customer is a valid customer, and that the activity is on the list of the available activities. If not, an appropriate message should be displayed on the screen. If the request is a valid one, the program should check whether there are enough tickets left for the ordered activity. You may assume that in one transaction a customer orders tickets for one activity. If the tickets are not available (or there are not enough tickets), a note (in the form of a letter) should be printed to a file informing the customer that the tickets are not available; no other errors should be logged to letters.txt. You may assume that the order is either fully satisfied or not carried out at all. If the ordered number of tickets is available, the transaction should be processed and the stored information should be updated accordingly. 4. When tickets (a ticket) are (is) cancelled by a customer, your program must check whether the customer is a valid customer, whether the activity specified by the tickets is on the list of activities and whether the tickets have been purchased by this customer. If not, an appropriate message should be displayed on the screen. If the request is a valid one, the stored information should be updated accordingly. You may assume that a customer can cancel tickets for only one activity per one transaction. If a customer has tickets for an activity, they should be able to cancel one, some or all of their tickets for that activity in a single transaction (your program should ask them how many tickets they want to cancel). 5. We assume that the ticket office only sells the tickets initially allocated to it, serves only its registered customers and processes transactions sequentially, one after the other. 6. When the program first starts, you should assume that no tickets have been sold so far. Marking Scheme The total number of marks which can be awarded for this coursework is 50. Marks will be awarded as follows: • Activity, Customer, SortedArrayList classes: 15 marks • Input and Output: 6 marks • Implementation of operations: 15 marks • Readability of code: 8 marks • Evidence of testing: 6 marks

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!