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
suter [353]
3 years ago
15

Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 5

0 miles, and 400 miles.
Ex: If the input is 20.0 3.1599
The output is: 1.57995 7.89975 63.198
Computers and Technology
1 answer:
Anna007 [38]3 years ago
8 0

Answer:

Explanation:

The following is written in Python. It is a function that takes in two parameters called miles for miles/gallon and gasCost for gas dollars/gallon. Then it creates three variables for each number of miles used (10,50,400) and calculates the total cost for each. Finally, it returns all three costs to the user

def mileage(miles, gasCost):

   tenMiles = (10.00 / miles) * gasCost

   fiftyMiles = (50.00 / miles) * gasCost

   fourHundredMiles = (400.00 / miles) * gasCost

   return tenMiles, fiftyMiles, fourHundredMiles

You might be interested in
The pseudo-class selectors for links let you use CSS to change the formatting for all but one of the following. Which one is it?
aev [14]
B. A link that is inactive
7 0
3 years ago
Write C code for a getCommonNeighbors function that accepts two vertex struct pointers, u and v, and returns unordered_set conta
LenaWriter [7]

Answer:

Hi how are you doing today Jasmine

8 0
3 years ago
What IP address is used as a loopback address and is not a valid IP address that can be assigned to a network
devlian [24]

Answer:

127.0.0.1

Network 127.0. 0.0 is reserved for IP traffic local to your host. Usually, address 127.0. 0.1 will be assigned to a special interface on your host, the loopback interface, which acts like a closed circuit.

Hope this can help you!

4 0
3 years ago
Is it ok to use a does red wine clean the inside of a computer true or false
Dmitry [639]
I don't understand what you are saying but I'm willing to help
4 0
3 years ago
Read 2 more answers
Write a program. in QBAsSIC
goblinko [34]

Answer:

The program is as follows:

<em>5 INPUT A,B</em>

<em>6 PROD = A * B</em>

<em>7 PRINT PROD</em>

<em>8 TOTAL = A + B</em>

<em>9 PRINT TOTAL</em>

<em>10 DIFF = A - B</em>

<em>11 PRINT DIFF</em>

<em>12 END</em>

Explanation:

This gets input for the two numbers

<em>5 INPUT A,B</em>

This calculates the product

<em>6 PROD = A * B</em>

This prints the calculated product

<em>7 PRINT PROD</em>

This calculates the sum

<em>8 TOTAL = A + B</em>

This prints the calculated sum

<em>9 PRINT TOTAL</em>

This calculates the difference

<em>10 DIFF = A - B</em>

This prints the calculated difference

<em>11 PRINT DIFF</em>

This ends the program

<em>12 END</em>

5 0
3 years ago
Other questions:
  • Write a program that uses a two dimensional array to store the highest and lowest temperatures for each month of the calendar ye
    10·1 answer
  • Web-based e-mail like Hotmail is an example of three-tier client-server architecture that provides access to e-mail messages. Tr
    7·1 answer
  • When making an on-site service call, what should you do before making any changes to software or before taking the case cover of
    6·1 answer
  • Encryption is the key to keeping your personal information secure online.<br><br> True<br><br> False
    11·1 answer
  • The engineering firm you work for is submitting a proposal to create an amphitheater at a state park. Proposals must be submitte
    15·1 answer
  • Which computer network component connects two different networks together and allows them to communicate?
    8·2 answers
  • my I phone is in recovery mode and when I connect to my PC the I device is not connected to iTunes although i have the latest ve
    7·2 answers
  • Is Missouri a free state or a slave state​
    13·2 answers
  • Why must a satellite have distinct uplink and downlink frequencies.​
    6·1 answer
  • Firestick optimizing system storage and applications loop
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!