Question
CSCI 1302 # Homework A0: Toms Trucking Demonstrated proficiency: Decision, Loop, Arrays, Strings, Console Output, Console Input. Tom owns a trucking business that transports crates
CSCI 1302
# Homework A0: Toms Trucking
Demonstrated proficiency: Decision, Loop, Arrays, Strings, Console Output, Console Input.
Tom owns a trucking business that transports crates of fruits from farms in southeast Georgia to a processing plant in Atlanta.
Each day Tom has at least two trucks available for transporting crates of fruits, sometimes more than two trucks. The trucks are either large trucks or small trucks or a combination of large/small trucks. The maximum number of crates that the large truck can carry is 100 crates. The maximum number of crates that the small truck can carry is 10 crates. A truck cannot carry more than the maximum number of crates. A truck cannot carry less than zero crates.
Complete the program "TomTrucking.java" so that it will allow Tom to
- Enter the numeric value of the number of trucks he has for the day.
- If it is less than 2, display a message then exit the program.
- Enter the string large or small for the size of each truck he has for the day.
- If the user enters an incorrect string, display a message and then allow them to reenter the size for that truck.
- Enter the actual number of crates each truck is carrying. If it is less than zero or greater than maximum number of crates, display a message then then allow them to reenter the actual number of crates the truck is carrying.
- Calculate the percentage of load capacity of each truck, that is actual/ maximum * 100. Display the information in a line for each truck.
- Give the truck number, the maximum number of crates it can carry, the actual number of crates that the truck is carry today and the percentage load capacity.
Complete the code before the due date. Submit the java source code, not a word document.
_________________________________________________________________________
Example output:
__________Example 1
How many trucks are operating today (Number of trucks must be 2 or greater)? : 1
You entered a value less than 2 for number of trucks.
Input errors, terminating program.
__________ Example 2
How many trucks are operating today (Number of trucks must be 2 or greater)? : 2
What is the size of truck 1 (large trucks max crates = 100, small trucks max crates = 10)? large
What is the actual number of crates that truck 1 is hauling today (Truck 1 max crates is 100)? 100
What is the size of truck 2 (large trucks max crates = 100, small trucks max crates = 10)? small
What is the actual number of crates that truck 2 is hauling today (Truck 2 max crates is 10)? 8
Entry for all trucks completed
Tom's Trucking Daily Report
---------------------------
Truck 1 max: 100 actual: 100 capacity at: 100%
Truck 2 max: 10 actual: 8 capacity at: 80%
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started