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
Make and run a Python program which:
PSYCHO15rus [73]

Answer:

ok

Explanation:

6 0
2 years ago
A utility program that makes a copy of all files or selected files that are in the libraries is called ______
sleet_krkn [62]

Answer: File History

8 0
3 years ago
A search engine is aprogram to search......<br>​
coldgirl [10]
Yes it is. Why are you asking?
4 0
3 years ago
The use of encryption and authentication protocols is the standard method of countering attempts to alter or insert transmission
enyata [817]

Answer:

a) true.

Explanation:

Encryption is a form of cryptography and typically involves the process of converting or encoding informations in plaintext into a code, known as a ciphertext. Once, an information or data has been encrypted it can only be accessed and deciphered by an authorized user.

Some examples of encryption algorithms are 3DES, AES, RC4, RC5, and RSA.

On the other hand, authentication can be defined as the process of verifying the identity of an individual or electronic device. Authentication work based on the principle of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication ensures a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification.

Digital certificates, smart cards, picture passwords, and biometrics are used to perform an authentication.

<em>Hence, in cybersecurity the use of encryption and authentication protocols is the standard method of countering attempts to alter or insert transmissions. </em>

5 0
3 years ago
Given an array declared to hold 100 values, the smallest index that can be used with the array is
Aneli [31]
In C influenced languages - 0.
8 0
3 years ago
Other questions:
  • You've formatted the first paragraph of a document. What button can you use to apply the formatting from the first paragraph to
    9·2 answers
  • What is the decimal equivalent of the binary number 1102?
    8·2 answers
  • teve wants to use Google Display Ads to reach new customers who are looking to purchase products similar to his. Which audience
    14·1 answer
  • The practice of using similar but not identical domain names is called _____. domain spoofing domain masquerading domain tasting
    13·1 answer
  • When does information become a liability for an organization
    6·1 answer
  • Write a program that reads in ten numbers and displays the number of distinct numbers and the distinct numbers separated by exac
    7·1 answer
  • If your machine is not used as a server and is not on a local network, what packet-filtering strategy should you use?A. Block al
    12·1 answer
  • Write a parent program to fork(2) n processes where n is passed tothe program on the command line, and n can be from 1 to 10. Al
    12·1 answer
  • Kai notices his laptop is running sluggishly, so he wants to check his system resources for any issues. Which utility can he use
    11·2 answers
  • Perceptron simplest definition
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!