A write a class called traffic violations that determines


Write a Java program that can be used to calculate and notify violators of the fines and/consequences forroad traffic breaches as shown in the schedule below.The violation notice may comprise of any of the following:

  • One or more of non-moving violations alone.
  • Combination of non-moving violations, and one kind of moving violation for excess speeding,or speeding in construction zone, but not both.
  • Combination of non-moving violations, and one kind of moving violation for speeding in schoolzone, or speeding in toll facility, but not both.
  • One kind of moving violation only, for excess speeding, or speeding in construction zone, butnot both.
  • One kind of moving violation for speeding in school zone, or speeding in toll facility, but notboth.

In formulating your solution:

(a) Write a class called Traffic Violations that determines types of traffic violations.

(b) Write a test class called TestTrafficViolations that implements the class TrafficViolations.

(c) Demonstrate knowledge of the if statement and the switch statement by using the if/else statementto determine the miles, and the switch statement for the other criteria.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: A write a class called traffic violations that determines
Reference No:- TGS01677660

Now Priced at $30 (50% Discount)

Recommended (98%)

Rated (4.3/5)