Ask Question
14 February, 20:53

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 (""); }}

+5
Answers (1)
  1. 14 February, 21:05
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers