Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

n this lab you ll be building a tool to allow people to compare their vehicles. So , basically, assume a family has multiple vehicles

n this lab youll be building a tool to allow people to compare their vehicles. So, basically,
assume a family has multiple vehicles theyre able to use and theyre trying to decide which
vehicle would be best to use on a road trip.
Your job is to create a program that takes in how many miles their trip is supposed to be and the
average gas price of their journey. You should then ask how many vehicles theyd like to
compare. While looping, ask the names (make and model) of each vehicle and their gas
mileage and tank capacity. After receiving the information, calculate how many tanks of gas it
would take for each vehicle and what the projected price would be for the journey. Display this
information to the user.
Your price should be based on how much it is to fill up a full tank on each individual vehicle.
You shouldnt just calculate how many gallons that car would need and then calculate that cost.
You also cannot have PARTIAL tanks. If its 2.1 tanks, you should display 3 tanks and calculate
it for 3 tanks.
Finally, at the end of the program, you should display the best name / cost of the car based on
the calculations.

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

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions