Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
Data Element Class - Ticket Include private instance variables to store information needed for a ticket. Select the correct data types for each one.
Data Element Class - Ticket
- Include private instance variables to store information needed for a ticket. Select the correct data types for each one. The speed and speed limit will be integers and that the school zone and work zone will be Boolean.
- A constructor that takes the name, speed, speed limit, school zone and work zone.
- Another constructor that takes the name, speed and speed limit. The school zone and work zone will be set to false.
- Getters and setters for the private instance variables.
- A public method calculateFine which calculates and returns the fine (as a double) based on the table in Assignment Details.
- A public method printNotice which returns a String with the contents of the Notice. Make sure that your fine is formatted in decimal format. Please see the Assignment Details for exact wording/format. Use your name instead of Professor Kartchner.
- A private method generateTicketNum which randomly generates a ticket number between 100000 and 999999 inclusively.
- A private method generateCourtDate which randomly generates a day between 1 and 31 inclusively. All court dates will take place in October 2018.
- A private method ticketType which returns a string of either "Payable" or "Must Appear" based on the table in Assignment Details.
- A toString method that returns a string representation of a Ticket, including the ticket number and ticket type. No specific format required.
- The method headers must match the Javadoc provided for you for the Ticket class.
Driver Class - TicketDriver
- Student created
- This is the driver class for Ticket that contains a main method.
- The driver is responsible to:
- print a header
- ask the user for information about a ticket.
- Print out the notice for that ticket using the methods from the Ticket class.
- Allow user to add another ticket.
- When user is finished entering tickets, prints "Exiting the Ticket Manager"
- Refer to the program sample run for more clarification.
- Data Validation. The following data must be validated:
- Speed > 0
- Speed Limit >0 and <= 80
- Add any necessary methods to modularize your code.
The fines will be based on the following:
dont worry about the fines I already have the calculation
Take screenshots of two runs of your program with different data.
Here is an example of the notice based on the following data:
Name: