Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do not give me something thats already been on chegg. In this lab you'll be building a tool to allow people to compare their

Please do not give me something thats already been on chegg.
image text in transcribed
In this lab you'll be building a tool to allow people to compare their vehicles. So, basically, assume a family has two vehicles they're able to use and they're trying to decide which vehicle would be best to use on a road trip. Your job is to create a program that takes in the names (make, model, year) of two vehicles and their gas mileage and tank capacity. You should then ask the user how many miles their trip is supposed to be and calculate how many tanks of gas it would take for each vehicle. Finally, you should get an average gas price (for instance, $1.99 per gallon) and list how much that particular vehicle would cost. Finally, your program should display the information in a clean, formatted way. It should resemble a table of some sorts. Have a header and each column a set width. Here's what mine are in my code: Car - width of 30 spaces Tanks - width of 10 spaces (left aligned) Cost - this one doesn't matter so much since it's the last column (I didn't format that to any specific number of spaces) You can assume the values won't cause it to go over the set number of spaces. Notes: When calculating how many tanks of gas is needed, you'll need to round up. So, if your vehicle takes 3.4 tanks, your program should print that it'll need 4 tanks. Also, make sure you're formatting your costs to two decimal points and include a dollar sign (directly next to it). A price of $2.40 should not read "$ 2.4". Additionally, your price should be based on how much it is to fill up a full tank on each individual vehicle. You shouldn't just calculate how many gallons that car would need and then calculate that cost

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_2

Step: 3

blur-text-image_3

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

What is management growth? What are its factors

Answered: 1 week ago