write a program in java to accept the time in minutes. Convert it to hours and minutes and display it.
Answers
Answered by
0
Answer:
If you want to do this yourself, go the other way.
- Divide the number by 60 * 24. (That will get the number of days.)
- Divide the remainder by 60. (That will give you number of hours.)
- The remainder of #2 is the number of minutes.
Answered by
2
Answer:
import java.util.Scanner;
public class MathUnitConversions14 {
public static void main(String[] args) {
long hours;
Scanner in = new Scanner(System.in);
System.out.println("Please enter hours:");
hours = in.nextLong();
long minutes = hours * 60;
System.out.println(minutes + " Minutes");
}
}
_________________________________
I took a little help from the web. It worked for me.
Similar questions