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
2 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]2 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]2 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
A ________ is an application program that runs on a server-tier computer and manages processes such as items in a shopping cart
garik1379 [7]
Commerce Server

An application program that runs on a server tier computer. A typical commerce server obtains product data from a database, manages items in users' shopping carts, and coordinates the checkout process.
6 0
2 years ago
Which of the following not a hardware componet​
erma4kov [3.2K]

Answer:

antivirus.......hope this answers your question

3 0
2 years ago
Secure shell (SSH) operates over which port by default
Karolina [17]

Explanation:

By default, SSH opens port 22.

However, this can be arbitrarily changed.  So if port 22 does not work, it is necessary to check the exact/new port number.

5 0
2 years ago
In a system with paging as the address translation mechanism, using multi-level paging always causes less memory usage for stori
Zarrin [17]

Answer:

The given statement is "True". A further explanation is given below.

Explanation:

  • Multi level paging can conserve storage capacity as opposed to sequential paging, including some of its hierarchical method Multi-level paging completing such.
  • Rather precisely, with either the aid of the number of co-association, clients will determine which unique category of 2²⁰ pages whose data are stored as well as the pick itself.
3 0
3 years ago
Packet switching is most efficient for ________ data.
Mars2501 [29]
Similar data ...hope it helped
3 0
3 years ago
Other questions:
  • Sarah maintains a blog about her soap-making business, and she has hired someone to create a database for this business. She mak
    6·1 answer
  • WordArt styles allow you to add ____.
    9·1 answer
  • You would like to create a graph that shows how much of your total investments are in stocks, savings, and mutual funds. You sho
    5·2 answers
  • PLEASE HELP ASAP i will mark brilliant
    12·2 answers
  • What are the basic tools for coding HTML manually?
    10·2 answers
  • Which number is the decimal equivalent of 1100110 – 101101?
    13·2 answers
  • Write pseudocode instructions to carry out each of the following computational operations:1. Determine the area of a triangle gi
    12·1 answer
  • One friend claims that a dual-core system runs at twice the speed as a single-core system; another friend disagrees by saying th
    13·1 answer
  • Write an application that inputs a five digit integer (The number must be entered only as ONE input) and separates the number in
    10·1 answer
  • 12.2 Sort an array in ascending order Write a program that gets a list of integers from input, and outputs the integers in ascen
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!