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]
3 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]3 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
Audrey would like to save her document. She should choose the Save command from the _____. folder menu window directory
Damm [24]

Answer:

File folder

Explanation:

6 0
3 years ago
Which of the following statements is true of satellite internet access?
MA_775_DIABLO [31]

Answer:

So, to get a more simplified version of the question, we will now assemble all the statements and one by one describe them.

Explanation:

  1. Satellite internet is obviously not the slowest forms of access, And its more expensive to connect to.
  2. Yes, satellite access do provide access to remote rural areas.And they require a system of antennas in order to connect from the earth to the satellite which is providing the services.
  3. Yes satellites internet works by sending and receiving messages or data required via a transmitter and receiver antenna, which connects the users device to the satellite providing the services.
  4. The satellite internet do cover a very large portion of Earths surface as there are now many number of satellites sent to the space which has made the communication system more fast and convenient to use.
3 0
3 years ago
Which of the following statements is true? A. Marking a presentation as final is stronger security than password protection. B.
Natali5045456 [20]
B is the answer to this questionn...
5 0
3 years ago
Read 2 more answers
How can an antivirus protect your device​
Igoryamba
Antivirus software protects your device from viruses that can destroy your data, slow down or crash your device, or allow spammers to send email through your account. Antivirus protection scans your files and your incoming email for viruses, and then deletes anything malicious
3 0
2 years ago
Read 2 more answers
Eight houses represented as cells are arranged in a straight line java int state []
monitta

Answer:

int state[] = new int[8];

8 0
4 years ago
Other questions:
  • What key combination in excel takes you back to the first cell
    7·1 answer
  • Convert each of the following bit patterns into whole numbers. Assume the values are stored
    14·1 answer
  • Mohammed's parents learn that his classmates have
    7·2 answers
  • The What is the pathname that starts from the working directory. directory?
    7·1 answer
  • Give the algorithm and flowchart for following C code:
    6·1 answer
  • Which software development team memeber is responsible for the timeline and budget
    9·1 answer
  • What is the value of alpha[3] after the following code executes?
    6·1 answer
  • Please answer<br><br>NO LINKS​
    7·1 answer
  • Any device that uses light to read and write information.
    9·2 answers
  • What allows a programmer to write code quickly and efficiently for an action that must be repeated?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!