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
5. The coordinates of triangle ABC are A(-7, 3), B(3, -7) and C(8. 8)
kati45 [8]

Answer:

b

Explanation:

6 0
3 years ago
Read 2 more answers
If you flash UEFI and now your computer is no longer working, is there anything you can do to correct the situation?
Annette [7]

<u>Solution and Explanation:</u>

Unified Extensible Firmware Interface (UEFI) is a software program which connects the computer's firmware to its operating system (OS). UEFI is installed by the manufacturer and the first program to be executed when the computer is not turning on. UEFI or BIOS can be corrupted because of the upgrade error or any other damage.

Launch an automatic BIOS/UEFI recovery of the system so that the previous working best version of UEFI/BIOS is recovered and made available. On successful recovery of the BIOS/UEFI, the computer starts working.

6 0
2 years ago
Take any software or Application that you have recently purchased, this can be a video game or any other application helping you
IgorC [24]

A good product should have copyright protection which prevents others from using the product without permission.

Some products specify the penalties which are given to a person who makes unauthorized copies of their product and this is done to clearly educate to avoid ignorance claims.

A good product should have clear lettering which are legible and can be easily read, and should also have reasonable copyright protection.

<h3>What is Copyright?</h3>

This refers to the licensing which is done for a product and is also legally backed which prevents a person from illegally using or redistributing the work of a creator without their explicit consent.

Read more about copyright infringement here:
brainly.com/question/1078532

8 0
2 years ago
Why is it worth remembering “All people seem to need data processing”?
Rzqust [24]
The answer is .........C
3 0
3 years ago
Read 2 more answers
If you are writing an algorithm and you aren’t confident that you understand the problem, what can you do?
Zigmanuir [339]

Answer:

divide it into smaller pieces

Explanation:

Usually, the main reason a programmer does not understand a problem fully is that there is too much information. The best way to try and fully understand a problem is to divide it into smaller pieces. Start off by answering the question what is the expected output for an input. Then divide each individual issue within the problem. This will allow you as a programmer/developer to create an individual solution for each individual issue within the problem and then test to make sure that the input gives the correct output.

8 0
2 years ago
Other questions:
  • To include totals and other statistics at the bottom of a datasheet, click the ____ button on the HOME tab to include the Total
    12·1 answer
  • Joshua wants to be a lawyer. He found the following table on the Bureau of Labor Statistics’ website to find out about the emplo
    13·2 answers
  • Buying an existing business
    7·1 answer
  • What type of interview would be most likely for the following scenario?
    11·2 answers
  • Elizabeth types in the following search terms: "Adoption AND cats AND NOT Persians." what results will her search provide?
    12·2 answers
  • In the table below identify the data type that would be most suitable for the second field
    14·1 answer
  • Data flow is not a major consideration when building an analytics model. T/F
    13·1 answer
  • Problem 3. Consider the following recurrence, defined for n a power of 4 (for the time of some algorithm): T(n) = 3 if n = 1 2T(
    5·1 answer
  • A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes: Ab
    11·1 answer
  • What is the purpose of quick access toolbar?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!