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
// This pseudocode is intended to describe
ddd [48]

Applying given information of a computational language in pseudocode, a code may be written to represent computing the price of an item on sale for 10% off.

<h3>What is a pseudocode?</h3>

A pseudocode can be considered as a depiction of the steps represented in an algorithm, usually in plain (natural) language.

<em>//This </em><em>pseudocode </em><em>is intended to describe</em>

<em>//computing the </em><em>price </em><em>of an </em><em>item </em><em>on </em><em>sale </em><em>for 10% off</em>

<em>START</em>

<em>  input origPrice</em>

<em>  </em><em>discount </em><em>= origPrice * 0.10</em>

<em>  </em><em>finalPrice </em><em>= origPrice - discount</em>

<em>  output finalPrice</em>

<em>STOP</em>

<em>//This pseudocode is intended to </em><em>compute </em><em>the number</em>

<em>//of miles per </em><em>gallon </em><em>you get with your car.</em>

<em>START</em>

<em>  input milesTraveled</em>

<em>  input gallonsOfGasUsed</em>

<em>  milesPerGallon = milesTraveled / gallonsOfGasUsed</em>

<em>     //milesPerGallon is computed using </em><em>division</em>

<em>  output milesPerGallon</em>

<em>     //miles is misspelled, and the P in </em><em>milesPerGallon </em><em>should be uppercase</em>

<em>STOP</em>

<em>  //</em><em>Program </em><em>should end with stop</em>

<em>//This pseudocode is intended to describe</em>

<em>//computing the </em><em>per day cost </em><em>of your rent</em>

<em>//in a 30-day month</em>

<em>START</em>

<em>  input rent</em>

<em>  costPerDay = rent / 30</em>

<em>     // Comment indicates 31-day month</em>

<em>  output costPerDay</em>

<em>     // output should be </em><em>costPerDay</em>

<em>STOP</em>

Learn more about the pseudocode here :

brainly.com/question/13208346

#SPJ1

3 0
1 year ago
I am trying to make a flowgorithm chart for a dogs name, age, weight and when their weight is less than 50 OR more than 100 its
kumpel [21]

Answer:

i think it helps

Explanation:

sorry there was someone else rude as heck messaging and responding I couldn't see their screen name

what isig naame

oh okay

I have sent dm

i dont know your name there

5 0
2 years ago
All of the following are parts of the word processing window except _____. \
Rainbow [258]
<span>All of the following are parts of the word processing window except for the button esc ____.</span>
5 0
3 years ago
C programming:
mixas84 [53]
IsTeenager = ( ( kidAge >= 13 ) && ( kidAge <= 19 ) ) ? true : false;

Another way:

if( ( kidAge >= 13 ) && ( kidAge <= 19 ) )
  isTeenager = true;
else
   isTeenager = false;
8 0
3 years ago
Which is better? iPhone 11 Pro Max or Samsung Galaxy Note 20 Ultra 5G and why?
Allisa [31]

Answer:

Samsung note 20 or iPhone but i think Samsung

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • The range A2:B4 has how many cells?<br><br> Answers:<br> 2,4,6,8
    10·2 answers
  • Users can make notes or highlight areas of a website and then use the ________ feature of Microsoft Edge to send the highlighted
    13·1 answer
  • All digital images are made up from varying rectangles of color, called _____________.
    6·2 answers
  • apple and adobe are in disagreement about the use of __________ to create apps for the iphone and ipad?
    10·1 answer
  • Write a java program that prompts the user to input the elapsed time for an event in hours, minutes, and seconds. The program th
    13·1 answer
  • Public class Main{ public static void main(String [] args){ String name=WelcomeJava; Runnable r1=() -&gt; System.out.println(nam
    12·1 answer
  • What invention in the past do you think had a significant impact on our culture/ lifestyle? What do you think will be invented/
    11·1 answer
  • Star and peer-to-peer are types of
    9·2 answers
  • Define two benefits to members of the community of replacing the printed copy with an online version.
    5·1 answer
  • The…..executed simple
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!