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
pogonyaev
3 years ago
5

One lap around a standard high-school running track is exactly 0.25 miles. Write a program that takes a number of miles as input

, and outputs the number of laps. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf("%.2f", yourValue); Ex: If the input is:
Computers and Technology
2 answers:
Sedaia [141]3 years ago
6 0

Answer:

def miles_to_laps(miles):

  return miles / 0.25

miles = 5.2

num_of_lap = miles_to_laps(miles)

print("Number of laps for %0.2f miles is %0.2f lap(s)" % (miles, num_of_lap))

Explanation:

salantis [7]3 years ago
5 0

Answer:

import java.util.Scanner;

public class Miles {

public static void main(String[] args) {

   //initialization

       double Number_Miles;

       //print the message

       System.out.print("Enter the number of miles: ");

       Scanner scn1 = new Scanner(System.in);

       

       Number_Miles = scn1.nextDouble();  //read the input from user

       //calculate the laps

       double yourValue = Number_Miles/0.25;

       //display the output on the screen

       System.out.printf("%.2f", yourValue);

     

}

}  

Explanation:

First import the library Scanner than create the class and define the main function. In the main function, declare the variables.

print the message on the screen and then store the value enter by the user into the variable.

Scanner is a class that is used for reading the output. So, we make the object of the class Scanner and then object call the function nextDouble() which reads the input and store in the variable.

After that, calculate the number of laps by dividing the number of miles with the given one lap running track value (0.25 miles).

Number\,of\,laps = \frac{Number\,of\,miles}{0.25}

the output is stored in the variable.

After that, print the value on the screen with 2 digits after the decimal point.

we can use "%.2f" in the printing function in java.

like System.out.printf("%.2f", output);

You might be interested in
Which of the following would be a show stopper for the development of an enterprise mobile app? The app demands data throughput
mestny [16]

Answer:

The cost of the app development is far greater than the tangible and intangible projected benefit of the app.

Explanation:

The first option is not correct, as in such cases, the app will be available in other areas. Also in case of a bad market share, it is not clear whether the app business will be profitable or not. And hence this is also not a correct option. However, the third option can be a show stopper, as it suggests the app business is not profitable, and no business or app developer is going to make such an app. And the fourth option is wrong, as some Governments will allow the app usage, and the app can still earn the profit. And hence, the correct option is as mentioned in the Answer section.

6 0
4 years ago
Which of the following terms refers to the horizontal line of continuous cells in a table?
vova2212 [387]

I believe it's a Row and A Intersection, though I'm not completely sure.

3 0
4 years ago
Read 2 more answers
After a business transaction has been analyzed, which of the following must occur for the analysis to have been done correctly?
ICE Princess25 [194]

Answer:

A. Equity must equal the difference between assets and liabilities.

Explanation:

Assets are things a company or business owns while liabilities are things person or company owes.

Thus, Equity is the difference between the assets and the liabilities.

So, option A which is <u>Equity must equal the difference between assets and liabilities</u> is the answer.

5 0
3 years ago
An ergonomic keyboard is one that has been designed to fit the natural placement of your hands.
Natasha_Volkova [10]
True
hope this helps 
have a nice day
3 0
3 years ago
Read 2 more answers
In Excel, by default, text is ____ in a cell.
Elanso [62]
<span>In excel, by default, the text is Left-alligned in a cell.
Usually, the text really is in left-aligned even in word documents. 
It's up to the user's preference to change the alignment of the text or do changes in any design.</span>
8 0
4 years ago
Other questions:
  • You will use the _____
    15·2 answers
  • A ________ is a set of rules that governs data communication.
    14·1 answer
  • The drone intercepts at 1256 hour. what time do they plane to take control of the drone
    11·1 answer
  • Enter the value of 5⋅(13.5−4.5). <br> ​
    5·1 answer
  • Which type of view is created from the following SQL statement? CREATE VIEW balancedue AS SELECT customer#, order#, SUM(quantity
    15·1 answer
  • ________________ is a new method or idea or product or enhancement or other means of adding value to an existing product, such t
    14·1 answer
  • Which of the following are provided by most
    5·1 answer
  • How we can load program on the browser window.​
    7·2 answers
  • Describe s computer network that you are familiar with ?
    8·1 answer
  • Graph the functions 8n, 4nlogn, 2n
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!