Complete the method definition to output the hours given minutes. Output for sample program: 3.5

Complete the method definition to output the given times to minutes. Output to sample program: 3.5

Complete the method definition to output the given times to minutes.  Output to Sample Program 3.5


Answer


import java.util.Scanner;

public class HourToMinConv {
    public static void outputMinutesAsHours(double origMinutes) {
        System.out.print(origMinutes / 60);
    }

    public static void main(String[] args) {
        Scanner scnr = new Scanner(System.in);
        double minutes;

        minutes = scnr.nextDouble();

        outputMinutesAsHours(minutes); // Will be run with 210.0, 3600.0, and 0.0.
        System.out.println("");
    }
}

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *