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]
3 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]3 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
what is the best paper choice for printing a book with 1000 pages A. Cover B. Text C. Index D. Newsprint​
Eva8 [605]

Answer:

B

Explanation:

Text is the best paper choice.

Have a great day

3 0
2 years ago
PLEASE HELP ME GIVING BRAINLIEST!!<br> 3.4.3: Go Down Slide: Part one
AlekseyPX

                                           above

dgczjklcxhvzkojcvrhyujnhb

explanation:

7 0
2 years ago
Which of the following is not a characteristic of a motorcycle?
MrRa [10]

Answer:

the correct answer is A

3 0
3 years ago
Work done by computer as per the instructions is called​
Alex17521 [72]

Answer:

The process of storing and then performing the instructions is called “running,” or “executing,” a program. By contrast, software programs and procedures that are permanently stored in a computer's memory using a read-only (ROM) technology are called firmware, or “hard software.”

Explanation:

hope it helps you and give me a brainliest

6 0
2 years ago
Read 2 more answers
What happens if a sequence is out of order?
andre [41]

Answer:

If you are trying to put the events in order and they are out of order you will probaly get the question wrong so make sure the events are in order.

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • When employees are hired, they agree to only use cell phones during breaks. How would you classify this?
    13·2 answers
  • What is malware short for?
    13·2 answers
  • Write an examples of Output device, storage devices and inputs device 10 each excluding the common ones​
    5·1 answer
  • When you identify the data elements in a new database, you typically subdivide data elements into?
    14·1 answer
  • Which statement is not true? An audit objective for systems maintenance is to detect unauthorized access to application database
    8·1 answer
  • Linda wants to apply for a job in a company of her choice. Which information would her potential employers likely review in her
    10·2 answers
  • I need help with yes lol please and thank you
    15·2 answers
  • Describe two different examples of potential conflicts, and explain why these conflicts can have a negative impact on
    14·1 answer
  • Compare the graphs. Find the value of h, k, or a.
    7·1 answer
  • Find the double word-length 2's complement representation of each of the following decimal numbers:a. 3874
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!