Write a class called trafficviolations

Assignment Help JAVA Programming
Reference no: EM131596600

Purpose of exercise: To understand and implement the selection constructs.

Write a Java program that can be used to calculate and notify violators of the fines and/consequences for road traffic breaches as shown in the schedule below.

Non-Moving Violation

  • No driver's license

$25.00

  • Expired tag

$20.00

  • No registration

$20.00

  • No insurance

$10.00

Moving Violation

• Speeding violation or speeding in construction zone Miles over the Speed Limit1 - 5 MPH Warning
6 - 9 MPH      $130.00
10 - 14 MPH   $205.00
15 - 19 MPH   $405.00
20 - 29 MPH   $455.00
30 MPH or over appearance   $605.00 and court

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 school
zone, or speeding in toll facility, but not both.
- One kind of moving violation only, for excess speeding, or speeding in construction zone, but not both.
- One kind of moving violation for speeding in school zone, or speeding in toll facility, but not
both.

In formulating your solution:

(a) Write a class called TrafficViolations 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 statement to determine the miles, and the switch statement for the other criteria.

Reference no: EM131596600

Questions Cloud

What is the one food-related regulation : If you had unilateral power, what is the one food-related regulation that you would impose - or abolish? Why would you take this action?
What is metapro direct labor cost variance for august : MetaPro Systems is a start-up company that makes connectors for high-speed Internet connections. What is MetaPro's direct labor cost variance for August
Troubleshooting of complex eigrp networks : Explain and demonstrate competence in the configuration and troubleshooting of complex EIGRP networks
Calculate the variable overhead cost variance for tradiant : Radiant Systems allocates manufacturing overhead based on machine hours. Calculate the variable overhead cost variance for tRadiant
Write a class called trafficviolations : Write a Java program that can be used to calculate and notify violators of the fines and/consequences for road traffic breaches as shown in the schedule
Summarize the facts in narrative or outline form : Summarize the facts in narrative or outline form. Include the most important and pertinent incidents in the situation. (Do not simply restate the entire case.
Compute the operating profit that will be earned : Willow Golf Course is planning for the coming golfing season. Compute the operating profit that will be earned
Discuss the threats when moving to the cloud : Why each of the below are considered new threats when moving to the cloud?
Identity three types of pricing strategies : Identity three types of pricing strategies. Select a good or service and compare the prices of two different companies associated with the goods or service.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Program that allows the user to enter the last names

Write a program that allows the user to enter the last names of 5 candidates in a college election and the votes received by each candidate. The program should then output each candidates name, the votes reveived by that candidate

  Design a class named magazinesubscription

Design a class named MagazineSubscription that has fields for a subscriber's name, the magazine name, and number of months remaining in the subscription.

  Use java or c++ to create a program for making the pizza

Make the Pizza example abstract, so that there are three kinds of factories under one AbstractPizzaFactory You can use Java or C++

  Write a client server program using tcp sockets

1) Write a client server program using TCP where client sends two numbers and server responds with sum of them.2) Write a client-server program using TCP sockets to echo the message send by the client.

  Produce a design document

You will design and deliver a website foes fictional client part-1 Website Design Document and produce a design document

  Assume that you are developing a java program which uses

suppose that youre developing a java program that uses decimal numbers and youd like to control the formatting of your

  Write a program that asks user how many students to process

Write a program that asks the user how many students to process (must be at least 1, but no more than 20) and then reads in the scores for three items, an exam average score (double number), lab average score (double number) and homework average s..

  Develop your first android app which simply displays text

Develop your first Android App, which simply displays the following text: "Hello Android, my name is ." Test your deveopment environment using the sample project (legacy-Snake).

  Description of routes and services

Write a method for finding a journey from one station to another using an algorithm that is specified below in this handout.

  Create the physical process model

You were hired as an analyst to develop a new information system to automate the payroll transactions in a mid-size organization. The proposed system will contain employees' data and interface with the organization's General Ledger system (GL).

  Case study - bug tracking system

A bug can be defined as an unexpected defect in a computer program. Number of faults, flaws and imperfection can be encountered in an application developed with a given technology and platform. All these bugs should be reported to the organization..

  State the approximate worst-case running time

If you are unsure of one of the calls into the Java Platform APIs, think about how the method might be implemented, and/or read its documentation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd