Language:EN
Pages: 11
Words: 1951
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
determine the violation importance and violation i

Determine the violation importance and violation impact based the violation type

Solved Step By Step with Explanation – Automated Traffic Violation Management

Question

When a resident makes a violation, their information is recorded. In our setting, a record is added to the text file “input.txt”.

You need to write a program that retrieves each record and processes the violation and then store it as an object by itself. For example, the record is:

Violation Date: 4.

Today: 15 (so, this person has not paid their violation yet).

Crossing Red Light RED 3000 High SDL (the DL is suspended) + DVF (Double the violation fine) + Warrant is issued.

Use of Mobile While Driving MBD 500 Medium DVF (Double the violation fine)

Parking in Handicapped spots HCP 3000 Medium DVF (Double the violation fine

The DVF (Double the violation fine) works as follow:

Warrant is issued: the police force will issue a warrant for the owner of the violation.

Project requirements:

Deliverables:

Write a report on your project that has the following information:

Store the data in a linked list (singly, doubly or array list).

Process the data and send warnings to users as described early. You may send the warning using print statements; see a sample from the expected output section.

Writing the processed data into a text file.

Your report shall have screenshots of the calculated running times above.

Java program.

The output text file.

All project-related questions will be answered in CLASS.

Submit through Moodle. EMAIL submissions are NOT ACCEPTED.

4500 is the new amount for the owner of A1A1A1 because he was 11 days late in paying the violation fine.

True: means this person’s DL must be suspended immediately. A search warrant is issued for this person.

Submitting a complete folder through Moodle -10

Providing a logical high-level description 2 -2

Writing a professional report 2 -2

Total 10 0

Writing pseudocode and high-level design:

https://bmci.edu.pk/wp-content/uploads/2020/05/Algorithm-and-Flow-Chart-notes-for-10th-class.pdf

https://www.baeldung.com/java-clock

https://www.geeksforgeeks.org/java-time-clock-class-in-java/

https://www.h2kinfosys.com/blog/reading-and-writing-text-file-java/

Java & Single Linked List:

Solved Step By Step with Explanation – Automated Traffic Violation Management

Solution:

1. Read the input text file ("input.txt") containing the records of traffic violations.

d. Calculate the Violation Fine Amount and whether the driver's license should be suspended (SDL).

e. Check if the fine is paid within the first ten days and apply DVF (Double the violation fine) accordingly.

Java Program:

Here's a Java implementation of the above high-level solution:

import java.time.LocalDate;

import java.time.temporal.ChronoUnit;

String violationImportance;

boolean SDL;

this.violationFine = violationFine;

this.violationImportance = violationImportance;

public class SaherTrafficSystem {

public static void main(String[] args) {

String[] parts = line.split(", ");

String plateNo = parts[0];

int violationFine = getViolationFine(violationType, daysElapsed);

boolean SDL = false;

} else if (daysElapsed > 20) {

SDL = true;

}

reader.close();

private static int getViolationFine(String violationType, int daysElapsed) {

int violationFineAmount = 0;

case "MBD":

violationFineAmount = 500;

case "C1S":

violationFineAmount = 3000;

case "LWS":

violationFineAmount = 1500;

default:

break;

return (int) (violationFineAmount * 1.5);

}

case "RED":

case "NSB":

case "MBD":

case "2PS":

}

}

2. Processing each record: O(1) - The processing for each record involves simple calculations and switch-case statements.

Overall, the time complexity of the program is O(N).

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Sara Smith

PageId: DOCFFFBF77