Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 : Fuel Efficiency Design a program that calculates the fuel cost per 1 0 0 miles and how far the car can go

Problem 1: Fuel Efficiency
Design a program that calculates the fuel cost per 100 miles and how far the car can go with a full tank of gas.
Your program needs to acquire the following inputs from the user:
(1) the number of gallons of gas in the tank
(2) the fuel efficiency in miles per gallon
(3) the price of gas per gallon
Your program needs to display the cost per 100 miles and how far the car can go with a full tank of gas.
Extra requirements:
Your program must start with a display to the user what the program does.
When acquiring the information from the user, your program must give clear instruction on what data
the user should input and in what format (whole number or floating-point number).
When displaying any monetary amount, your program must prefix the amount with $ and keeps
exactly two digits after the decimal points.
The variable names must be descriptive to the quantity they represent.
The number of miles the car can go with a full tank of gas must be displayed as a whole number.
Your code for this problem
Run the code and insert the result in the following box.
image text in transcribed

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

ISBN: 0132742926, 978-0132742924

More Books

Students also viewed these Databases questions