code to determine distance and time in java

Solutions on MaxInterview for code to determine distance and time in java by the best coders in the world

showing results for - "code to determine distance and time in java"
Klara
19 Feb 2020
1import java.util.Scanner;
2import java.text.DecimalFormat;
3import java.text.NumberFormat;
4public class Lab3 {
5    public static void main(String[] args) {
6        int time = 0;
7        int distance = 0;
8        int speed = distance/time;
9        float fval = speed * time;
10        double dval = distance/speed;
11        String message;
12        Scanner scan = new Scanner(System.in);
13        System.out.println("Please Enter Your Avaerage Speed: ");
14        message = scan.nextLine();
15        System.out.println("You Entered: \"" + message + "\"");
16        System.out.println("Your Total Speed is: "); 
17