CS619 Test Phase 2018
Test Phase Statement
Due date: Tuesday, July 17th 2018
Problem Statement
The Department of National Highways Pakistan is installing a toll collection system on one of its major roads. Trucks pulling up to a tollbooth are required to pay a toll of Rs. 5 per axle plus Rs. 20 per ton of the truck’s total weight. A display in the booth shows the toll receipts and the number of truck arrivals since the last collection.
You will design an object oriented program in Java that simulates the operation of the tollbooth.
Sample Scenario
To understand the problem statement let’s imagine how such a toll collection system might work. A toll agent at tollbooth has a computer screen and a bar code reader. When a truck arrives at the booth, the agent scans a bar code on the windshield of the truck; it contains information about the truck, including its number of axles. The weight of the truck is obtained by scanning a bar code contained on the bill of lading presented by the driver. The truck information and toll due are then displayed on the computer screen:
For Example:
Truck arrival – Axles: 5 Total weight: 12500 Kg Toll due: Rs.300
When a button on the side of the screen is pressed, the booth’s totals are displayed:
Totals since last collection – Receipts: Rs. 605, Trucks: 3
This scenario will be simulated by the object oriented system that you will build.
Primary Objects in the Problem Statement
The primary objects of the tollbooth model problem are the relevant noun phrases of the problem statement. In this case we list: trucks, tollbooth, axle, weight, receipts. Of these, tollbooth and truck are the most important. Axles and weight are properties of a truck, and receipts are secondary to the tollbooth. Therefore, we chose truck and tollbooth as our primary types.
Trucks Behaviors and Attributes
Toll depends on the number of axles and weight of a truck. Tollbooths need to get both of these from a truck. Therefore, a truck should keep track of the number of axles it has and its total weight.
Tollbooth Behaviors and Attributes
The main behavior required of a tollbooth is the ability to calculate the toll due. We also want to be able to display the data for the total receipts and number of trucks since the last receipt collection. This implies that these totals can be reset by the tollbooth on receipt of collection.
Directions to complete the assignment
- Create and compile a java class (TollBooth)
- TollBooth class that implements the behaviors and attributes of a Truck and calculate the toll due. TollBooth class should have the member variables (attributes) as identified earlier (axles, totalweight). Carefully choose the access level modifier and make sure that you take into account the fact that some variables change over time and others don’t.
- Gets the axles and total weight of each truck by using the parameterize constructor.
- Create a method truckData() that display the truck data on screen.
- Create another method calculateToll() that implements the specified behaviors and attributes of Tollbooth. This method keeps track of a) calculate the toll due for each truck, b) the total number of trucks that have gone through the tollbooth and c) total receipts since collection.
- Create a method displayData() will perform the following functions:
- a) Display the last calculated toll for truck
- b) Display the total number of trucks that have gone through the tollbooth
- c) Display total receipts since collection and then reset them to zero.
Remember that totals are maintained only since the most recent collection. This corresponds to the supervisor of the tollbooth, emptying the cash box in the booth and resetting the meters.
Using the tollbooth
The following represents sample usage code for the class above. You may use it to test your overall implementation. Create an object of TollBooth class and calculate the toll for minimum 3 trucks.
Class TestTollBooth {
Public static void main (String [] args){
}
}
NOTE:
The test phase coding explanation is based on programming in Java language. However, you can develop the coding in any of the programming language like C++, C# etc. according to your convenience.
i need this
contact on details below
Can u provide with solution
yes
Get help with
Phd, Masters Thesis & Mcs Final Project
MBA Final Project
Cs619,Fin619,Mgt619,Bnk619,Hrm619,Mkt619
WhatsApp: 00971-545074598
Skype: trust_aware
Email: projecthelp77@gmail.com
Can u please provide me the solution of this assignment
wtsapp 03125718857