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
1) APPLICATION BASED QUESTION:-
schepotkina [342]

Answer:

Photoshop

Explanation:

8 0
3 years ago
Write a program that print "Censored" if userInput contains the word "darn", else print userInput. End with newline.
Ainat [17]

Answer:

userInput = input("Please enter a string of words ")

userInput.split ()

for item in userInput.split ():

   if item =="darn":

       print("Censored")

       break

else:

   print(userInput)

Explanation:

Using Python programming language, the input function is used to receive the users input and save in a variable userInput

Then the .split method is used to convert the words into a list of words.

Using a for loop, the code checks for the word darn and prints censored if it exists else it prints the userInput

7 0
3 years ago
Which type of books contains snapshots of steps that help to perform an activity?
stellarik [79]

Answer:

online book,,.........,.

5 0
3 years ago
Read 2 more answers
_____ are like selection lists in which they limit fields to a set of possible values; but, unlike selection lists, the options
natali 33 [55]

Radio buttons exist like selection lists in which they limit fields to a set of potential values; but, unlike selection lists, the options appear as respective controls in the web form.

<h3>What is Radio button?</h3>

A radio button or option button exists as a graphical control element that permits the user to select only one of a predefined set of mutually exclusive options. The singular property of a radio button causes it distinct from checkboxes, where the user can select and unselect any numeral of items.

Radio buttons exist as a common way to permit users to make a single selection from a list of options. Since only one radio button can be selected at a period (within the same group), each available option must be its item and label. Radio buttons exist like selection lists in which they limit fields to a set of potential values; but, unlike selection lists, the options appear as respective controls in the web form.

To learn more about Radio button refer to:

brainly.com/question/20476366

#SPJ4

8 0
2 years ago
Which option correctly identifies if the researcher’s approach was the best start in the following scenario and explains why?
dem82 [27]

Answer:

The first one

Explanation:

The other ones don’t make sense

4 0
3 years ago
Read 2 more answers
Other questions:
  • You need to fax a portion of a map from a large hard-cover atlas to a client from an internal fax-modem. To fax the map, the bes
    14·1 answer
  • Consists of a drive letter (preceded by a drive name when necessary) and colon, to identify the storage device, and one or more
    5·1 answer
  • What happens if you never confirm your facebook account?
    8·1 answer
  • When examining the digital evidence, what stage deals with using keyword searches and file-carving utilities to locate data that
    5·1 answer
  • What kind of physical device is an evil twin access point? What does the evil twin do after initial association when the victim
    12·1 answer
  • write pseudocode to represent the logic of a program that allows the user to enter a value for one edge of a cube. The program c
    13·1 answer
  • Explain why it is important to follow a course or a program in keeping with your value system​
    13·1 answer
  • Write a function called play_round that simulates two people drawing cards and comparing their values. High card wins. In the ca
    11·1 answer
  • How to transfer word 2019 from one computer to another
    12·1 answer
  • Can I have some help?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!