Description
Part 1:Coding
Now that you have the JAVA class source code to implement the PayStation application. Each class has been tested using the JUnit testing tool. Now you’ll put all the pieces together to complete a final product. In this lab assignment, you are required to develop a main program to demo to the clients how the product works.
A main() program should be developed to simulate the PayStation operation. It displays a menu to allow a customer to select a choice:
- Deposit Coins
- Display
- Buy Ticket
- Cancel
- Empty (Admin)
- Change Rate Strategy (Admin)
A maintenance worker may select the Admin menu options to empty the PayStation or Change Rate Strategy while the PayStation system is running. When Change Rate Strategy is chosen, a submenu will show different city names with their respective rate strategies.
The simulation software should show the following features:
- accept coins for payment.
- 5, 10, 25 cents
- show time bought on display.
- when a parking ticket is bought, prints a receipt with parking time.
- when a transaction is canceled, prints the returned coins’ values and number of each coin type.
- Implement rate strategies for five clients:
- Linear1 rate for Alphatown (5c buys two minutes)
- Progressive rate for Betatown (see below)
- Alternating1 rate for Gammatown (weekdays:progressive + weekend:linear1 ).
- Linear2 rate for Deltatown (5c buy 1 minute)
- Alternating2 rate for Omegatown (weekdays:linear1 + weekend:free).
- Rate strategy selections and changes can be done on the fly, i.e. at run-time. The default rate strategy is linear1 (Alphatown) rate.
- Alternating rate is a hybrid rate depending on the day of the week. Linear1 rate applies on weekends and progressive rate applies on weekdays.
- To get extra credit: account for weekend rollover (if a user enters coins at 11:30pm on Sunday, the first 30 minutes use linear rate, and any further coins use progressive rate). Don’t worry about splitting coins (quarter entered at 11:55pm can give 10 minutes according to linear rate).
- Java’s Calendar class provides a good starting point for this requirement.
- Calendar’s set() will be helpful for testing purposes.
- Summary:
- <em>/* <strong>Linear1 Rate Strategy</strong> */</em> time = (amount * 2) / 5; <em><strong>/* Progressive Rate Strategy */</strong> /* less than an hour (60 Min) so amount <150 */</em> time = (amount * 2) / 5; <em>/* between 1st hour and 2nd hour so 350>amount >=150 */</em> time = (amount - 150) * (3 / 10) + 60; <em>/* greater than 2 hours so amount >= 350 */</em> time = (amount - 350) / 5 + 120; <em>/* <strong>Alternating1</strong><strong> Rate Strategy</strong> */ /* On Weekdays Uses Progressive Rate */ /* On Weekends Uses Linear1 Rate Strategy */</em> <em>/* <strong>Linear2 Rate Strategy</strong> */</em> time = amount / 5; <em>/* <strong>Alternating2</strong><strong> Rate Strategy</strong> */ /* On Weekdays Uses Linear1 Rate */ /* On Weekends Free */ </em>
Part 2:PayStationMain main program and rate strategiesObjective:
- Draw a UML class diagram (Use any tool you prefer https://www.draw.io/ (Links to an external site.) is a free suggestion). Example for PayStationTDD UML Class Diagram (Links to an external site.).
What to submit?
- The first part of the Design Document with the Architecture
- A complete UML Class Diagram for the full project even if the code is not written yet. You will be allowed to update the diagram for the final submission.
- Do not forget to represent the Main() method so we can identify in which class it is located.
Unformatted Attachment Preview
Purchase answer to see full attachment
Explanation & Answer
View attached explanation and answer. Let me know if you have any questions.Hello,the zip contains the code. You will also find javadoc html files, an UML file realized with the objectaid software and a document called documentation.rtf with description of classes and methods realized with javadoc and the rtf doclet.You can test the software using your IDE or by running the class with the main method (PayStationImpl).The design document is instead the report realized according to specifications, with description of classes and methods and with explanation of design choices as well.Let me know if everything is alright.
PayStation Main
Design Document
CIS 3296 Section 0x
Spring 2022
Team Members:
Repository URL:
-
1 | Page
1/22/2022
Table of Contents
Document Overview
3
Architecture
3
Detail Design API
Package edu.temple.cis.paystation
public class Linear2RateStrategy implements RateStrategy
public interface PayStation
public class Alternating2RateStrategy extends AlternatingRateStrategy
public class Linear1RateStrategy implements RateStrategy
public class AlternatingRateStrategy implements RateStrategy
public class IllegalCoinException extends java.lang.Exception
public interface Receipt
public class ReceiptImpl implements Receipt
public class ProgressiveRateStrategy implements RateStrategy
public class FreeRateStrategy implements RateStrategy
public class PayStationImpl implements PayStation
public interface RateStrategy
public class Alternating1RateStrategy extends AlternatingRateStrategy
4
4
4
4
5
5
5
6
6
6
6
7
7
8
8
2 | Page
1/22/2022
Document Overview
This Design Document describes the software architecture and how the requirements are mapped into the
design. This document is a combination of diagrams and text that is describing what the diagrams are
showing. The first section is Architecture and shows the classes UML diagram, along with an explanation
of the design and design choices. The second section is Detail Design API and specifies classes and methods
using a Javadoc format.
Architecture
This section describes the different components and their interfaces using UML. This diagram shows the
classes to be developed (or used) and their relationship. Every class and interface represented in the diagram
is part of the same package.
Figure 1 UML Class...