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
Windows is a GUI Operating System, what is the other type?
alekssr [168]

Answer:

If you are looking for a different type of GUI operating system then :

Linux or mac

if you are looking for a different type of operating system (non-GUI):

Command-line interface

Explanation:

3 0
2 years ago
Please answer this correctly the underline drop down menu in the font group contains options to underline
andrew-mc [135]
All of the above, I believe.
3 0
3 years ago
Choose the missing words in the code below.
emmasim [6.3K]

Answer:

try

except

else

Explanation:

just got it right

4 0
2 years ago
Write a Java program to print the result in the series 10, 15, 20, 25, ..., 50. Hint: You can use an iteration statement for wri
Westkost [7]
Im really not sure but i need points so i can ask questions so i can get my math classes done so then i can graduate sos help
5 0
3 years ago
I need help plz it’s python
algol13

Answer:

The output of the first question would be 9. And the answer the second question is 10.

8 0
2 years ago
Other questions:
  • Which of the following situations would not require knowledge of networking?
    6·1 answer
  • Proxy data:
    12·1 answer
  • To name a computed field, follow the computation with the word ____ and then the name you wish to assign to the field
    8·1 answer
  • Your boss wants to utilize some sort of cloud storage for his files so that all of his
    10·2 answers
  • Lydia noticed that she feels tired and out of breath after walking her dog up a hill in the park. Which area of fitness does she
    8·1 answer
  • AYUDAAAA!!!!! URGENTE!!!!!!1<br> ¿para que sirve la "BIG DATA"?
    9·1 answer
  • How can we style the images and layouts of our pages?
    8·1 answer
  • How many total cells can a worksheet window contain? If columns are labelled alphabetically, what will be the label for the cell
    15·1 answer
  • DERECTIONS: Identify all the computer software that you need for the following entrepreneurial activities. Refer your answer fro
    5·1 answer
  • These brainly bots need to stop!!
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!