Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1. Write a program to help a local rental company identify which of its vehicles are suitable for hauling a specified load. Inputs to the

image text in transcribedimage text in transcribed
Q1. Write a program to help a local rental company identify which of its vehicles are suitable for hauling a specified load. Inputs to the program are: the name of the file containing vehicle data, the estimated weight of the load in pounds, and the estimated volume of the load in cubic feet. The program should correctly read the data file using a Scanner and print information on vehicles that can accommodate the load. A vehicle can accommodate a given load only if both the estimated weight and volume of the load do not exceed the maximum cargo weight and volume specifications of the vehicle. The data items are arranged as follows for each vehicle stored in the file: vehicle code daily rate space>maximum cargo weight maximum cargo volume vehicle type Below are the sample data file contents. Copy and save this to a file named fleet.txt. Vo01 90.0 4000 250 Ford Van 7002 99.0 2900 400 GM Small Truck V003 99.0 2900 400 GM Small Truck VO04 127.5 6160 860 Ford Medium Truck 7005 145.0 12900 1650 GM Large Truck Use ONLY topics covered in Modules 1 - 6 to solve question. You are NOT allowed to use ArrayLists. You may use arrays but they are not required to solve this problem. Here are 3 separate sample runs, user input is shown in bold underline:Sample Run #1 Enter fleet data filename: c:/temp/fleet . txt Estimated weight of cargo (pounds) : 80 Estimated volume of cargo (cubic ft) : 251 The following vehicles will accommodate this cargo load: V002 - GM Small Truck at $99.00 per day V003 - GM Small Truck at $99.00 per day V004 - Ford Medium Truck at $127.50 per day v005 - GM Large Truck at $145.00 per day * Sample Run #2 Enter fleet data filename: c: /temp/fleet. txt Estimated weight of cargo (pounds) : 13000 Practice Lab Exam #3 Estimated volume of cargo (cubic ft) : 1600 The following vehicles will accommodate this cargo load: Sample Run #3 Enter fleet data filename: c: /temp/fleet. txt Estimated weight of cargo (pounds) : 3500 Estimated volume of cargo (cubic ft) : 500 Focus

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions