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
nalin [4]
4 years ago
12

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: 1.5 the output is: 6.00 Exc If the input is: 2.2 the output is: 8.80 Your program must define and call a method: public statie double milestoLaps (double userkiles) LAB ACTIVITY 6.23.1 LAB Miles to track laps 0/10 LabProgram java Lood default template1 import java.util.Scanner; 2 3 public class LabProgram 4 5 public static double wiles Tolaps(double userMiles) 6 return userMiles / 0.25; 7 89 10 Scanner in new Scanner (System.in); 11 System.out.printf(x 27, wilestoLaps(in.nextDouble()); 12 }13 14 }15
Computers and Technology
1 answer:
postnew [5]4 years ago
4 0

Answer:

import java.util.Scanner;

public class LapToMiles {

   public static void main(String[] args) {

       System.out.println("Enter Number of Miles");

       Scanner in = new Scanner(System.in);

       double numMiles = in.nextDouble();

       double numberOfLaps = milestoLaps(numMiles);

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

   }

   public static double milestoLaps(double numMiles){

       //One lap = 0.25 miles

       double numberOfLaps = numMiles/0.25;

       return numberOfLaps;

   }

}

Explanation:

Create a Method milestoLaps that converts number of laps to number of miles

Within the main method call milestoLaps and pass your entered value for miles

format the output with printf()

You might be interested in
The encapsulating security ______ protocol provides secrecy for the contents of network communications as well as system-to-syst
Goshia [24]

Answer:

payload

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

The encapsulating security payload (ESP) protocol is a standard protocol that provides secrecy for the contents (data) transmitted via network communications, as well as system-to-system authentication and data integrity verification so as to prevent unauthorized access.

Basically, the encapsulating security payload (ESP) protocol is a transport layer protocol that provides data confidentiality, integrity and authentication in IPv6 and IPv4 protocols.

5 0
3 years ago
Which characteristic describes a flash lighting setup?
Amanda [17]

Answer:

A

Explanation:

The flash lighting setup is controlled by a sensor, the same sensor that you the camera has when to detect to put on the flash therefor it becomes similar to color temp. hope this helps!!

4 0
3 years ago
To support an internet client, you must have six elements. the first three -- a computer, an operating system and tcp/ip -- are
UkoKoshka [18]
<span>Client software, Internet connection and Internet address</span>
6 0
3 years ago
Find the ratio of 24 to 36​
miv72 [106K]

Answer:

24:36 if you want it in the smallest form it is 2:3

4 0
3 years ago
Read 2 more answers
Hello can you please help with this if you want to thank you!
nikklg [1K]

Answer:

hardware and software is the answer

8 0
3 years ago
Read 2 more answers
Other questions:
  • an organization that maintains a gateway to the Internet and rents access to customers on a per-use of subscription basis\ and W
    11·1 answer
  • Which type of operation writes the file system structure to the disk?
    5·1 answer
  • Consider the following method:
    8·2 answers
  • Memory is the place of the computer where data and instructions are stored either permanently or temporarily. True or false.​
    11·1 answer
  • Why is failure important when you are designing a solution to a problem?
    6·2 answers
  • Libby’s keyboard is not working properly, but she wants to select options and commands from the screen itself. Which peripheral
    14·1 answer
  • If a employee has a grade grater than or equal to 18, then he she will get 50% bonous on the basic pay. Otherwise, the employee
    5·1 answer
  • Does anyone know the name of the font :) ?
    14·2 answers
  • Computer father known as​
    5·1 answer
  • Contrast between functions of sort and sorted in python . ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!