Write a program to help a local rental company identify which of its vehicles are suitable...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 <newline> daily rate<space>maximum cargo weight<space>maximum cargo volume<newline> vehicle type<newline> Below are the sample data file contents. Copy and save this to a file named fleet.txt. V001 90.0 4000 250 Ford Van V002 99.0 2900 400 GM Small Truck V003 99.0 2900 400 GM Small Truck V004 127.5 6160 860 Ford Medium Truck V005 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): 800 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 #1 Enter fleet data filename: c:/temp/fleet.txt Estimated weight of cargo (pounds): 800 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 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 The following vehicles will accommodate this cargo load: V004 Ford Medium Truck at $127.50 per day V005 GM Large Truck at $145.00 per day. 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 <newline> daily rate<space>maximum cargo weight<space>maximum cargo volume<newline> vehicle type<newline> Below are the sample data file contents. Copy and save this to a file named fleet.txt. V001 90.0 4000 250 Ford Van V002 99.0 2900 400 GM Small Truck V003 99.0 2900 400 GM Small Truck V004 127.5 6160 860 Ford Medium Truck V005 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): 800 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 #1 Enter fleet data filename: c:/temp/fleet.txt Estimated weight of cargo (pounds): 800 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 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 The following vehicles will accommodate this cargo load: V004 Ford Medium Truck at $127.50 per day V005 GM Large Truck at $145.00 per day.
Expert Answer:
Answer rating: 100% (QA)
The Java program that takes the input file name estimated weight and estimated volume of the cargo a... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Now that you know what you want to do with your accounting degree and hopefully the CPA license, find that starting job. I would like you to find a job posting that you could apply to in your chosen...
-
What you want to achieve with the social media campaign and why ( business Objectives and Social media goals) Your answer should be related to the Alaska Glacial Mud skincare company wordcount 500...
-
Analyze for liquidity and solvency. Tell me what you feel about their financial position and why. Submit the copy of the balance sheet Innovative Products, Inc. Balance Sheet As at December 31, 2013...
-
?
-
Your firm uses a continuous review system and operates 52 weeks per year. One of the SKUs has the following characteristics. Demand (D) = 20,000 units/year Ordering cost (S) $40/order Holding cost...
-
There are four stated advantages of XBRL GL: reporting independence, system independence, consolidation, and flexibility. Match the advantage with the characteristic of XBRL GL. 1. XBRL GL offers an...
-
Lakewood Co. issues \(\$ 100,000\) of \(6 \%, 20\)-year bonds payable that are dated April 30. Record (a) issuance of bonds at par on Nay 31 (b) the next semiannual interest payment on October 31.
-
(a) Blank Company sells three different categories of tools (small, medium and large).The cost and market value of its inventory of tools are as follows. Determine the value of the companys inventory...
-
How does the phenomenon of "emotional contagion" influence group dynamics within organizations, and what strategies can leaders employ to mitigate its potentially detrimental effects on team cohesion...
-
4. Assume a 60-day T-bill, P = $9,700, face value is $10,000, (a) Calculate the bond equivalent yield? (b) Calculate the yield on a bank discount basis? (c) Calculate the effective annual rate...
-
Solve: x + x2 - x = -3 6x; + 2x2 + 2x, = 2 - 3.t, + 4x2 + x = 1 with (a) naive Gauss elimination, (b) Gauss elimination with par- tial pivoting, and (c) Gauss-Jordan without partial pivoting.
-
In assessing sampling risk, the risk of incorrect rejection of an account balance relates to the a. Efficiency of the audit. b. Effectiveness of the audit. c. Selection of the audit. d. Audit quality...
-
Which of the following is not among the errors that an auditor might include in test data when auditing a client's computer system? a. Numeric characters in alphanumeric fields. b. Differences in...
-
Definition of accounting terms The following is a list of accounting terms. Match the appropriate accounting term A through D to its definition 1 through 4. A. Accounting B. Bookkeeping C. Managerial...
-
Auditing by testing the input and output of a computer system instead of the computer program itself will a. Detect all program errors, regardless of the nature of the output. b. Not detect program...
-
To determine an optimum sample size when sampling methods are used in a substantive test, all of the following factors must be considered except the a. Variation in the population. b. Risk levels the...
-
Using C + + programming language , You are required to implement a prototype quiz / game in which the user is repeatedly presented with the name of a river and must guess which of four continents it...
-
The following cost information was provided to you for analysis: September 12,000 Units Produced Costs: TIC TAC TOE TING August 10,000 P80,000 70.000 60.000 50,000 How much is the fixed cost per...
-
Create additional select queries for Coast Jewelers using wildcards a. Create and print a select query for Coast Jewelers that lists the product name, quantity, supplier contact name, and supplier...
-
The Wine Depot is planning for the future and would like you to prepare a present value analysis. Using the file ch7-07, complete a present value analysis for the following situations save the file...
-
Salespeople earn a 7 percent commission on the price of each sale. Create a new unbound calculated control to compute the possible commission on each product. Modify the Products form by adding a...
-
Consider the part of the file system naming hierarchy illustrated in the following: a. In the path name and in the figure, identify the context that you should use for that resolution and the context...
-
Ben Bitdiddle has written a program with 16 major modules of code. Each module contains several procedures. In the first implementation of his program, he finds that each module contains at least one...
-
Ben Bitdiddle has accepted a job with the telephone company and has been asked to implement call forwarding. He has been pondering what to do if someone forwards calls to some number and then the...
Study smarter with the SolutionInn App