Fill This Form To Receive Instant Help
Homework answers / question archive / JAVA Complete the method definition to output the hours given minutes
JAVA Complete the method definition to output the hours given minutes. Output for sample program: 3.5
CODE below
public class HourToMinConv {
public static void outputMinutesAsHours(double origMinutes) {
/* Your solution goes here */
}
public static void main (String [] args) {
outputMinutesAsHours(210.0); // Will be run with 210.0, 3600.0, and 0.0.
System.out.println("");
}
}
Sample output:
3.5
60.0
0.0
Code to Copy:
// Declare the class
public class HourToMinConv
{
// Method declaration
public static void outputMinutesAsHours(
double origMinutes)
{
// statement to display minutes.
System.out.println(origMinutes / 60);
}
// start the main method.
public static void main(String[] args)
{
// call to the method.
outputMinutesAsHours(210.0);
outputMinutesAsHours(3600.0);
outputMinutesAsHours(0.0);
System.out.println("");
}
}
please see the attached file for complete solution