Create a GUI that pops up ONLY if the truck is selected. This new window should contain JLabels with JTextFields that allow the user to enter in all the truck's relevant information - e.g. Make, Model, Year, Number of Doors, Fuel Tank Capacity, Driving Range, Towing Capacity, Payload Capacity, and Extra Load. Use the same inputs from Main.java in the Appendix. The new window should also include two calculate MPG buttons – one for MPG without the extra load and one for MPG with the extra load. When pressed, the buttons use the truck constructor to compute the MPG and output the miles per gallon for each scenario. In this case, the MPG without the extra load is 25.0 and the MPG with the extra load is 24.25. Note: assume that the extra load is 100
Create a GUI that pops up ONLY if the truck is selected. This new window should contain JLabels with JTextFields that allow the user to enter in all the truck's relevant information - e.g. Make, Model, Year, Number of Doors, Fuel Tank Capacity, Driving Range, Towing Capacity, Payload Capacity, and Extra Load. Use the same inputs from Main.java in the Appendix. The new window should also include two calculate MPG buttons – one for MPG without the extra load and one for MPG with the extra load. When pressed, the buttons use the truck constructor to compute the MPG and output the miles per gallon for each scenario. In this case, the MPG without the extra load is 25.0 and the MPG with the extra load is 24.25. Note: assume that the extra load is 100
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images