View Full Version : Please fix this java question with code
sppanday
Sep 20, 2013, 08:46 PM
Please fix this coding with Java Programming.
Vehicle Make.. Model.. Noise Factor... InterstatePermitscurrent... Parking Fines
Holden... Colorado... 2.. . 0
Chrysler... Aspen... 3.. . 0
Toyota... Lite Ace... 4.. . 0
Ford... F350... 5... ….. . 0
Dodge... Sprinter... 6.. . 2
Hino... Ranger-Pro 9... 7.. . yes
Ford... LCF... 8.. . Yes
WesternStar.. 4900FXT... 10.. . Yes
Mack... Metro Liner... 11... Yes.. .
DAF... CF... 11... …... YES
Kenworth... T359... 12.. . No
Isuzu... Giga CXY... 12.. . No
Question :If the above vehicles were held in an ArrayList, how would you sort the list according to
Make?
a. To answer this question write the code to put them into an ArrayList and then sort it
By make.
b. Print each vehicle in the sorted ArrayList by make to the console.
Note:
Name the class: SortingArrayLists.java
sppanday
Sep 20, 2013, 08:49 PM
Please fix this coding with Java Programming.
Vehicle Make.. Model.. Noise Factor... InterstatePermitscurrent... Parking Fines
Holden... Colorado... 2.. . 0
Chrysler... Aspen... 3.. . 0
Toyota... Lite Ace... 4.. . 0
Ford... F350... 5... ….. . 0
Dodge... Sprinter... 6.. . 2
Hino... Ranger-Pro 9... 7.. . yes
Ford... LCF... 8.. . Yes
WesternStar.. 4900FXT... 10.. . Yes
Mack... Metro Liner... 11... Yes.. .
DAF... CF... 11... …... YES
Kenworth... T359... 12.. . No
Isuzu... Giga CXY... 12.. . No
Question
A trucking company prepares all its vehicles in the evening ready for departure from its depot
first thing the next morning (i.e. 6:00 am). Vehicles range from long haulage to local delivery
and rep vehicles.
Now, the exit road from the depot goes through a residential suburb. The company is very
community minded and wants to keep noise down to a minimum at such an early hour. So, a
cap (or limit) has been put on the amount of noise the fleet of vehicles can generate at any one
time as they leave the premises in the morning. The maximum noise level or factor is 24.
Information is provided below for the fleet of 12 vehicles. Each vehicle has a make, model
and a numeric noise factor.
Your job is to stagger the departure times of this fleet of vehicles, having them leave in
groups of three where possible, starting at 6:00 am. They should leave at 10 minute intervals
and the last group should leave by 6:30 am.
What you are asked to produce:
A program that will calculate departure groups and produce a report detailing the following
for each departure group –
• A listing of all vehicles by noise factor
contained in this listing should also be the make and model of each vehicle,
and any other information relevant to that vehicle
• A list of each departure group and the time it leaves the depot
include the total noise factor for the group
Your application should include the following:
• Appropriate object-oriented design of classes
• Inheritance, including overloaded constructors, calls to the super class’s constructor,
overriding methods and use of the super class’s existing methods.
You’ll notice that the vehicles could fall into two sub-categories
• An array to hold the vehicle-
Do not use an ArrayList for this question
• A method that sorts the array according to vehicle noise factor
• A method that decides vehicle groupings according to noise factor
-You must not manually force vehicles into groupings
*A hint: once the numbers are sorted in ascending order write this down and
you’ll soon see how to get three whose total is still <= 24
• Maximum group size is three vehicles
• The report should be formatted to look like a report
sppanday
Sep 20, 2013, 08:50 PM
Please fix this coding with Java Programming.
Vehicle Make.. Model.. Noise Factor... InterstatePermitscurrent... Parking Fines
Holden... Colorado... 2.. . 0
Chrysler... Aspen... 3.. . 0
Toyota... Lite Ace... 4.. . 0
Ford... F350... 5... ….. . 0
Dodge... Sprinter... 6.. . 2
Hino... Ranger-Pro 9... 7.. . yes
Ford... LCF... 8.. . Yes
WesternStar.. 4900FXT... 10.. . Yes
Mack... Metro Liner... 11... Yes.. .
DAF... CF... 11... …... YES
Kenworth... T359... 12.. . No
Isuzu... Giga CXY... 12.. . No
Question
A trucking company prepares all its vehicles in the evening ready for departure from its depot
first thing the next morning (i.e. 6:00 am). Vehicles range from long haulage to local delivery
and rep vehicles.
Now, the exit road from the depot goes through a residential suburb. The company is very
community minded and wants to keep noise down to a minimum at such an early hour. So, a
cap (or limit) has been put on the amount of noise the fleet of vehicles can generate at any one
time as they leave the premises in the morning. The maximum noise level or factor is 24.
Information is provided below for the fleet of 12 vehicles. Each vehicle has a make, model
and a numeric noise factor.
Your job is to stagger the departure times of this fleet of vehicles, having them leave in
groups of three where possible, starting at 6:00 am. They should leave at 10 minute intervals
and the last group should leave by 6:30 am.
What you are asked to produce:
A program that will calculate departure groups and produce a report detailing the following
for each departure group –
• A listing of all vehicles by noise factor
contained in this listing should also be the make and model of each vehicle,
and any other information relevant to that vehicle
• A list of each departure group and the time it leaves the depot
include the total noise factor for the group
Your application should include the following:
• Appropriate object-oriented design of classes
• Inheritance, including overloaded constructors, calls to the super class’s constructor,
overriding methods and use of the super class’s existing methods.
You’ll notice that the vehicles could fall into two sub-categories
• An array to hold the vehicle-
Do not use an ArrayList for this question
• A method that sorts the array according to vehicle noise factor
• A method that decides vehicle groupings according to noise factor
-You must not manually force vehicles into groupings
*A hint: once the numbers are sorted in ascending order write this down and
you’ll soon see how to get three whose total is still <= 24
• Maximum group size is three vehicles
• The report should be formatted to look like a report