1. Only agree if you can perform with proper specification.2. This assignment has connection with assignment 1 (102199) as expert has performed.3. If expert needs any additional notes need to ask, do...

1. Only agree if you can perform with proper specification.2. This assignment has connection with assignment 1 (102199) as expert has performed.3. If expert needs any additional notes need to ask, do not submit wrong work.4. Please Please follow the specification before working on this assignment .5. This assignment needs lot of concentrate and focus to avoid wrong work.6. Do not submit wrong work after taking lot of time.7. Comment each line of code.8. Go through the assignment first carefully then move forward.9.TheAssignment is in 2 parts; Part A (35%) and Part B (15%) Toal 50% so be alert.10. Anything unclear pls ask.11. Expert needs to connect with me.12. Do not assigned college or random people to solve this assignment, hence i will not be able to tell you the solution after paid you.





Microsoft Word - AP Assignment 2 Part A s1 .pdf Due date: 9.30pm, April 20, 2022 Introduction You are required to implement a basic Java program using Java SE 11. This assignment is designed to help you: 1. Practise your knowledge of class design in Java; 2. Practise the implementation of different kinds of OO constructs in Java; 3. Practise the use of polymorphism; 4. Practise error handling and Unit testing in Java; 5. Develop a reasonable sized application in Java; 6. Implement an MVC pattern and add a Graphical User Interface using Java Swing. This is an individual assignment and worth 50% towards your final grade. The full Assignment is in 2 parts; Part A (35%) is due on May 21 and will require a demo of non-GUI functionality; Part B (15%) will involve implementation of the Graphical User Interface and other additions (described below) to Part A. This assignment builds on Assignment 1; a sample solution to Assignment 1 will be made available on request; you are welcome to build on the sample solution. Part A: General Directions • All input data should be read from the standard input and all output data should be printed to the standard output. Do not use files at all. • Inputs should checked for validation or formatting errors. If an input is formatted incorrectly the execution should stop immediately (without crashing) and an appropriate error message should be displayed. • Marks will be allocated to your class design. You are required to modularise classes properly---i.e., to use multiple methods as appropriate. No method should be longer than 50 lines. • Marks will be allocated to proper documentation and coding layout and style. Your coding style should be consistent with standard coding conventions (see Java Code Conventions - Oracle) Overall Specification You will build out the MyTi system to manage multiple users making multiple journeys on the same day or over a number of days. This extends what you have done in Assignment 1. Journeys and Travel Passes The MyTi system is designed to automatically combine multiple Journeys in a day by one User into the cheapest Travel Pass that covers those Journeys. For example, if a User travels twice inside 2 hours, then a 2 Hour pass is purchased. However, if the user travels again later in the day, the 2 Hour pass may be turned into an All Day pass if that is cheaper than 2 2Hour passes. Each time the user asks for a new Journey, the previously purchased Travel Pass should be checked: 1. If the current Travel Pass is an All Day and we are in the day, then a new Travel Pass does not need to be purchased; 2. If the new Journey fits inside the 2 Hours of the current Travel Pass, then a new Travel Pass does not need to be purchased; 3. If the current Travel Pass is a 2 Hour and the new Journey is outside that time, then a new 2 Hour Pass needs to be purchased. UNLESS the new Travel Pass means that all that day’s Passes would add up to cost more than an All Day Pass---then all the Passes for that day are replaced by a single All Day Pass; in this case the MyTi card is charged the difference between what has already been paid that day, and what an All Day Pass would cost. 4. You have to do similar thinking about when different Journeys are in different Zones! I’ll leave that to you to think about J Note that Users do not purchase tickets or Travel Passes---they make Journeys and the MyTi system itself decides what type of Travel Pass to “purchase” for them. The first Journey for the day is automatically covered by a 2 Hour Pass. Other Journeys are worked out according to the logic above. To create a Journey, the system user must be prompted for: - The User whose MyTi card is to be charged; the day of travel, the start time and the end time; the starting Station and end Station of the journey. If a User tries to purchase a Journey that requires a new Travel Pass, or an upgrade from 2 Hour to All Day, and there is not enough credit left on their MyTi card, then the purchase of that Journey must fail (with an Exception), and the user told they need to recharge their card. Users Every MiTi ticket is associated with a unique User and every User has exactly one MyTi ticket at any time. You do not have to worry about a MyTi card being lost during a day. The MyTi ticket needs to know details of its user, such as name and email address. Each user has a unique id: if a new user tries to use an existing id then the operation should fail. A User may be an Adult, a Junior or Senior. A MyTi ticket is a FullMyTi if its User is an Adult, a JuniorMyTi if its User is a Junior, and a SeniorMyTi if its User is a Senior. JuniorMyTi and SeniorMyTi tickets are also ConcessionTickets with an associated discountRate--- you mst use a Java interface to implement this requirement. SeniorMyTi ticket holders travel free on Sundays---they do not have to pay for any journeys. discountRate is set at 0.5 (i.e. half-price) and is always the same for ALL Concession users, but this must be (theoretically) able to be changed. Day and Times To make things easier (and to run demos in less than real time!) you will type in the day and times of Journeys (rather than using a System call to get them automatically). Using a “24 hour” time representation should make it easy to determine the length of Journeys. Note that a Journey fits inside a 2 Hour pass if it ends before the end of the 2 Hour period. An All Day pass covers all journeys that start inside that day and runs from midnight to 23:59pm. (One day, all public transport in Melbourne will run 24/7!) Stations Stations have a unique name and each Station can tell which Zone it is in. TravelPass objects should be instances of specific subclasses of the main TravelPass class (which should not be instantiated). All TravelPass objects should store the information needed for all decisions described above (e.g. whether to add a new Journey into an existing TravelPass). Admin Functions You also need to implement the following system administration functions: - On request, print all TravelPasses purchased by all Users. This list should be ordered by User. For each TravelPass, list the Journeys that were in it (times commenced; station start.end-points); - Allow TravelPass prices to be altered: this requires input of the Travel Pass details (Duration, Zones) and new price; - Print usage statistics for all Stations: i.e., how many journeys started at each Station, how many finished at each Station; - Create a new User: this requires input of a new id (the operation fails if it is already in use), name, type (Adult, Junior, Senior), and email address. Program Development When implementing large programs, especially using object-oriented style, it is highly recommended that you build your program incrementally. This assignment proposes a specific incremental implementation process: this is designed to both help you think about building large programs, and to help ensure good progress! You are not strictly required to follow the structure below, but it will help you manage complexity. Step 1: Extend Assignment 1 Start by extending your Assignment 1 solution (a sample solution will be made available): 1. Rename your main class to MyTiSystem; 2. Extend your TravelPass class (if necessary) to contain all data and operations it needs (e.g. the Zone and Duration; Day and Start/End times) for Assignment 2; 3. Define Exceptions to handle problems/errors. These may include: trying to purchase a pass without having enough funds; recharging by an invalid amount; invalid menu options or inputs, etc. Step 2: Class Design Define all the classes and interfaces needed for the described system. In particular, you should try to encapsulate all the appropriate data and operations that a class needs. This may mean some classes refer to each other (e.g., the way Account refers to Customer). At this point, you may just want to think about the data and operations and just write the definitions, not all the code. You will be submitting or demonstrating your class design in tutes or labs before the due date. Details will be announced in lectures and on Canvas. Step 3: Main Program Your main program should be in the MyTiSystem class. (Of course, any class can contain a main(); this is useful for testing that class.) The main program contains a menu that offers the following options in a loop: 1. Buy a Journey for a User 2. Recharge a MyTi card for a User 3. Show remaining credit for a User 4. Print User Reports 5. Update pricing 6. Show Station statistics 7. Add a new User 8. Quit Since we are not dealing with a single MyTi ticket any more, we have to enter a User’s id to know which MyTi ticket to charge for a travel pass. (Alternatively, we could have used ticket id.) The system should keep a list of all its Users: this list must be efficient to look-up by User id, i.e., use a HashMap indexed by User/id. For option 1, note that you now buy “Journeys”. A journey may or may not require a new Travel Pass to be purchased---the user will receive a message as to what the system does with each request---i.e. buy a new Travel Pass, add it to an existing one, or
Apr 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here