1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MrRa [10]
2 years ago
5

g Assignment 8: Driving costs Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon as input, a

nd output the gas cost for 20 miles, 75 miles, and 500 miles.
Computers and Technology
1 answer:
zavuch27 [327]2 years ago
5 0

Answer:

miles_gallon = float(input("Enter car's miles/gallon: "))

dollars_gallon = float(input("Enter gas dollars/gallon: "))

print("Gas cost for 20 miles is $", (20 / miles_gallon) * dollars_gallon)

print("Gas cost for 75 miles is $", (75 / miles_gallon) * dollars_gallon)

print("Gas cost for 500 miles is $", (500 / miles_gallon) * dollars_gallon)

Explanation:

*The code is in Python.

Ask the user to enter the car's miles/gallon and gas dollars/gallon

Calculate the gas cost for 20 miles, divide 20 by miles_gallon and multiply the result by dollars_gallon, then print it

Calculate the gas cost for 75 miles, divide 75 by miles_gallon and multiply the result by dollars_gallon, then print it

Calculate the gas cost for 500 miles, divide 500 by miles_gallon and multiply the result by dollars_gallon, then print it

You might be interested in
What does a spam e-mail normally promise you?
nlexa [21]
The answer is a virus
7 0
3 years ago
The ______ network became functional in 1969, linking scientific and academic researchers across the United States. Group of ans
denis23 [38]

Answer:

The <u>ARPANET </u>network became functional in 1969, linking scientific and academic researchers across the United States.

Explanation:

ARPA Net is the network that has become functional in 1969 in united States. The basic purpose of this network is to link all the researchers and scientists across united states. The full form of ARPANet is Advanced Research Project Agency Network.

The importance of this network is increase because small chunks of data that are called packets has been proposed for data transmission in the network. The data is divided into small packets and send it over the network, at destination point these packets are combined together and become orignal information.

7 0
3 years ago
Read 2 more answers
True or false? you should avoid using your power point slides as handouts, according to the text.
vazorg [7]
True, you should avoid using power point notes always
4 0
2 years ago
Describe at least three things you could do to prepare for giving an effective and engaging business presentation. (1-3 sentence
puteri [66]
To prepare for giving an effective and engaging business presentation;
1. Know your subject and be able to answer questions.
2. Practice your presentation until you are confident in your delivery
3. Get plenty of sleep the night before and have a light breakfast the day of.
4 0
3 years ago
Read 2 more answers
Why is hard disk called random access medium​
Effectus [21]

Answer:

Data is accessed in a random-access manner, meaning the individual blocks of data can be stored and retrieved in any given order or time.

Explanation:

5 0
1 year ago
Read 2 more answers
Other questions:
  • Match the job titles to the tasks
    11·2 answers
  • Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    10·1 answer
  • Question 1 Multiple Choice Worth 5 points)
    10·1 answer
  • Please help me answer this<br><br>number 1..
    9·1 answer
  • 1. The programmer intends for this pseudocode to display three random numbers in the range of 1 through 7. According to the way
    12·1 answer
  • What type of ransomware was developed to block the user from accessing the computer and encrypts all the files on the user's dev
    5·2 answers
  • Networking and telecommunications technologies, along with computer hardware, software, data management technology, and the peop
    5·1 answer
  • A major public university graduates approximately 10,000 students per year, and its development office has decided to build a We
    10·1 answer
  • Write a Pascal program that will prompt the user to enter the radius of a circle.
    9·1 answer
  • a central issue in the microsoft antitrust lawsuit involved microsoft's integration of its internet browser into its windows ope
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!