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
Arlecino [84]
3 years ago
12

Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the ga

s cost for 10 miles, 50 miles, and 400 miles.
Ex: If the input is 20.0 3.1599, the output is:

1.57995 7.89975 63.198

Needs to be in Coral language
Computers and Technology
2 answers:
Tems11 [23]3 years ago
8 0

Answer:

def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon):

  gallon_used = driven_miles / miles_per_gallon

  cost = gallon_used * dollars_per_gallon  

  return cost  

miles_per_gallon = float(input(""))

dollars_per_gallon = float(input(""))

cost1 = driving_cost(10, miles_per_gallon, dollars_per_gallon)

cost2 = driving_cost(50, miles_per_gallon, dollars_per_gallon)

cost3 = driving_cost(400, miles_per_gallon, dollars_per_gallon)

print("%.2f" % cost1)

print("%.2f" % cost2)

print("%.2f" % cost3)

Explanation:

Ierofanga [76]3 years ago
6 0

Answer:

x^{2} \left[\begin{array}{ccc}1&2&3\\4&5&6\\7&8&9\end{array}\right] \int\limits^a_b {x} \, dx  \lim_{n \to \infty} a_n \sqrt{x} \sqrt[n]{x} \pi \alpha \frac{x}{y} x_{123} \beta

Explanation:

You might be interested in
A(n) _____ is substance in which one or more atoms have the same number of protons (i.e. the same atomic number).
natima [27]

I think it’s Element I think

3 0
3 years ago
How many times does the following loop execute?int upperCaseLetters = 0;String str = "abcdEfghI";boolean found = false;for (int
damaskus [11]

Answer:

Five times

Explanation:

Given the codes as follows:

  1.        int upperCaseLetters = 0;
  2.        String str = "abcdEfghI";
  3.        boolean found = false;
  4.        for (int i = 0; i < str.length() && !found; i++)
  5.        {
  6.            char ch = str.charAt(i);
  7.            if (Character.isUpperCase(ch))
  8.            {
  9.                found = true;
  10.            }
  11.        }

The for loop will stop when the first uppercase letter is found in the str. This condition is set in the for loop condition ( i < str.length() && !found)

Since the the first upper case letter is the fifth character in the given str, the for loop will run for five rounds. In the fifth round the condition in the if statement (Line 9) will be evaluated to true and then set the true value to found variable (Line 11). This will terminate the loop in the next iteration.

7 0
3 years ago
How can presentation software be used in a business or professional setting? Choose all that apply.​
ahrayia [7]

Answer:

Presentations are commonly projected onto a whiteboard a large screen.

Slides can also be printed out onto clear acetate and used with a overhead projector (0HP) to project the contact onto a screen. If this method is used each acetate side usually has to be replaced my newly.

Presentations can also be set up to play through a large did you go display in reception areas of the hotels, schools, businesses etc.

3 0
4 years ago
1k bits equals to how many bits
ruslelena [56]

Answer:

1000 bits

Explanation:

hope it helps :D

8 0
3 years ago
A customer has contacted you to help him alleviate the large amount of time and effort that goes into adding and removing users
Ostrovityanka [42]

Answer: On-demand

Explanation:

On-demand computing is the term of cloud computing that describes the function that provides organization with cloud hosting services. This function permits those organization to provide their customers for assessing computing resources and services as per necessity.

According to the question,on-demand is the computing function that should be used in the mentioned case. Technician and customers will get to access the computer as per their necessity and will not have to waste their efforts and time.

7 0
4 years ago
Other questions:
  • Excel 2016 is primarily what type of program?
    15·1 answer
  • Which one is a correct answer
    12·2 answers
  • Someone please help me with the right answer please
    13·1 answer
  • What specific type of DNS query instructs a DNS server to process the query until the server replies with an address that satisf
    5·1 answer
  • Create an application for a library and name it FineForOverdueBooks. TheMain() method asks the user to input the number of books
    7·1 answer
  • If you type too much text on a PowerPoint slide, the additional text is added to a second slide.
    9·1 answer
  • If a computer truncatesall numbers to two decimal places, compute the error forthe following: 23.345+222.34911)0.12)0.01413)0.14
    15·1 answer
  • Function of an actuator
    8·2 answers
  • Word-processing,spreadsheets, databases, and desktop publishing are all types of _______?
    12·2 answers
  • What line of code makes the character pointer studentPointer point to the character variable userStudent?char userStudent = 'S';
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!