Question: A private integer instance variable named axles. A private integer instance variable named weight. A private double instance variable named fee. A constructor that takes
A private integer instance variable named axles.
A private integer instance variable named weight.
A private double instance variable named fee.
A constructor that takes two integer parameters and sets the instance variables axles and weight accordingly.
A method named calculateToll which takes no parameters and ret no value, the method should calculate the toll paid by each truck and the instance variable fee the toll value paid
Each truck arriving at the toll both is required to pay a toll of $ per and $ per halfton of the truck's total weight. The weight shown in sample usage is in kilograms. Each ton is kilograms. Do not worr about truncated values due to integer division.
A method named displayReceipt which takes no parameters and no value, the method should display the transaction details as shown sample output.
Sample usage and output provided below.
Sample Usage:Sample Output:Axles: Weight: KilogramsToll paid: $Axles:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
