Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Speeding Tickets There are two types of speeding tickets in Maryland Payable and Must Appear. Payable tickets can be paid by mail, in person or

Speeding Tickets

There are two types of speeding tickets in Maryland Payable and Must Appear. Payable tickets can be paid by mail, in person or online. Must Appear tickets require the violator to appear at the County Court House in addition to paying a fine.

The DMV has asked you to build an application that will calculate the fees for a speeding tickets and then print a notice that will be mailed to the violator.

A driver and a utility class

UML diagram, class diagrams

Java fundamentals, including decision structures, loops

Constructors, Overloaded constructors

toString method

Formatting output with DecimalFormat

Random Class

Java objects & classes

Following a Javadoc

Data Element Class Ticket

Student Created

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.

GUI Driver Class TicketGUIDriver

Provided

Uses methods of the ticket class

Use as a way to test your cacluateFine and printNotice methods

Introduction to a Graphical User Interface (GUI) driver

Include the dmv.jpg in the same package as your .java files for the image to display.

Test Class TicketTestDriver

Provided

This is the driver class for testing the methods of the Ticket class. This has been given to you to help you test the methods of your Ticket class.

The fines will be based on the following:

Take screenshots of two runs of your program with different data.

Here is an example of the notice based on the following data:

Name: John Smith

Speed: 41

Speed Limit: 35

School Zone: Yes

Work Zone: No

Department of Motor Vehicles

Automated Traffic Enforcement

Dear John Smith,

Please pay the following speeding fine of $200.00 to the DMV within 10 days of

receiving this notice to avoid a drivers license suspension. You are being fined

for going 41 MPH in a 35 MPH school zone.

Ticket Type: PAYABLE

Ticket Number: 482957

Returned checks are subject to a returned check fee of $35.00.

Sincerely,

Professor Kartchner (put your name here)

Here is an example of the notice based on the following data:

Name: Betty Boop

Speed: 58

Speed Limit: 25

School Zone: No

Work Zone: Yes

Department of Motor Vehicles

Automated Traffic Enforcement

Dear Betty Boop,

Please pay the following speeding fine of $450.00 to the DMV within 10 days of

receiving this notice to avoid a drivers license suspension. You are being fined

for going 58 MPH in a 25 MPH work zone.

Ticket Type: MUST APPEAR

You must appear at the County Court House on October 5, 2018

Ticket Number: 936826

Returned checks are subject to a returned check fee of $35.00.

Sincerely,

Professor Kartchner (put your name here)

**Do not use color, this is for demo purposes only

Sample 1 shows multiple tickets being processed in one run

Ticket Manager

Enter the name of the violator: Poe Dameron

Enter the speed of the violator (>0): 54

Enter the speed limit (>0,<=80): 30

Was this in a school zone (Y/N): N

Was this in a work zone (Y/N): N

Department of Motor Vehicles

Automated Traffic Enforcement

Dear Poe Dameron,

Please pay the following speeding fine of $495.00 to the DMV within 10 days of

receiving this notice to avoid a driver's license suspension. You are being fined for going 54 MPH in a 30 MPH zone

Ticket Type: PAYABLE

Ticket Number: 161624

Returned checks are subject to a returned check fee of $35.00

Sincerely

Professor Kartchner

Do you want to enter another ticket? (Y/N)Y

Enter the name of the violator: Kylo Ren

Enter the speed of the violator (>0): 86

Enter the speed limit (>0,<=80): 45

Was this in a school zone (Y/N): Y

Was this in a work zone (Y/N): N

Department of Motor Vehicles

Automated Traffic Enforcement

Dear Kylo Ren,

Please pay the following speeding fine of $675.00 to the DMV within 10 days of

receiving this notice to avoid a driver's license suspension. You are being fined for going 86 MPH in a 45 MPH school zone

Ticket Type: MUST APPEAR

You must appear at the County Court House on October 16, 2018.

Ticket Number: 737022

Returned checks are subject to a returned check fee of $35.00

Sincerely

Professor Kartchner

Do you want to enter another ticket? (Y/N)N

Exiting the Ticket Manager

Sample 2 shows validation loops

Ticket Manager

Enter the name of the violator: Han Solo

Enter the speed of the violator (>0): -25

Enter the speed of the violator (>0): 59

Enter the speed limit (>0,<=80): -20

Enter the speed limit (>0,<=80): 85

Enter the speed limit (>0,<=80): 45

Was this in a school zone (Y/N): yes

Was this in a school zone (Y/N): Y

Was this in a work zone (Y/N): no

Was this in a work zone (Y/N): N

Department of Motor Vehicles

Automated Traffic Enforcement

Dear Han Solo,

Please pay the following speeding fine of $310.00 to the DMV within 10 days of

receiving this notice to avoid a driver's license suspension. You are being fined for going 59 MPH in a 45 MPH school zone

Ticket Type: PAYABLE

Ticket Number: 890645

Returned checks are subject to a returned check fee of $35.00

Sincerely

Professor Kartchner

Do you want to enter another ticket? (Y/N)N

Exiting the Ticket Manager

Example of Ticket GUI Driver:

Deliverables / Submissions:

Design: UML class diagram with algorithm (pseudo-code) for methods

Implementation: Submit a compressed file containing the follow (see below): The Java application (it must compile and run correctly); Javadoc files in a directory; a write-up as specified below. Be sure to review the provided project rubric to understand project expectations. The write-up will include:

Test Cases

Prepare a test table with a list of test cases (expected versus actual results) that you are testing the application with. There must be at least 4 sets of valid data and at least one set of invalid data.

Screenshots of at least two of the test cases in your test table.

UML diagram

In three or more paragraphs, highlights of your learning experience

Deliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats:

LastNameFirstName_Assignment5_Complete.zip, a compressed file in the zip format, with the following:

Write up (Word document) - reflection paragraphs, test cases, screenshots

UML Diagram - latest version (Word or jpg document)

doc (directory) - Javadoc

File1.html (example)

File2.html (example)

src (directory)

File1.java (example)

File2.java (example)

LastNameFirstName_Assignment5_Moss.zip, a compressed file containing one or more Java files:

File1.java (example)

File2.java (example)

This folder should contain Java source files only

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

l Compare internal and external sources of candidates.

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago