Ask Question
12 March, 03:32

Complete the method definition to output the hours given minutes. Output for sample program:3.5import java. util. Scanner; public class HourToMinConv { public static void outputMinutesAsHours (double origMinutes) { / * Your solution goes here * / } 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 (""); }}

+1
Answers (1)
  1. 12 March, 06:36
    0
    import java. util. Scanner;

    public class num1 {

    public static void outputMinutesAsHours (double origMinutes) {

    double hours = origMinutes / 60;

    System. out. println ("The converted hours is " + hours);

    }

    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,

    System. out. println ("");

    }

    }

    Explanation:

    The question required us to only write the statement to complete the line

    outputMinutesAsHours (double origMinutes) { / * Your solution goes here * / }

    The solution double hours = origMinutes / 60; solves this because there are 60 minutes in one hour, so to conver minutes to hours, you divide the number of minutes by 60
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Complete the method definition to output the hours given minutes. Output for sample program:3.5import java. util. Scanner; public class ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers