+5 votes

Well, I think this is just a simple assignment, so you don't need to (or even shouldn't) use Java library functions for this.

You'd need the following steps:

- Create an integral variable to store the minutes. For simplicity, call it
*minutes*. - Ask the user to provide the minutes, store it in your variable
*minutes*. - You need to create another variable that can store integral numbers to store the hours and one another for the days. (You can use double as well for floating point numbers, a.k.a. to have fractions.) You can call them
*hours*and*days*accordingly. - Calculate the hours and days by dividing
*minutes*with the appropriate numbers (how many minutes form an hour/day). - Print the calculated
*hours*and*days*to the user.

If you have never ever written any Java code, have a look at this or find your preferred tutorial.

Good luck!

commented
Sep 30, 2020
by
Jayden Neifert Reeves
(520 points)

Thank you kind stranger!

0 votes

60 minute = 1 hours

it means that 1 min = 1/60 hours

24 hours = 1 day

it means that 1 hour = 1/24 days

first take input time as minute then divide it (1/minute) for time in hours

then 1/hours for no of days

it means that 1 min = 1/60 hours

24 hours = 1 day

it means that 1 hour = 1/24 days

first take input time as minute then divide it (1/minute) for time in hours

then 1/hours for no of days

0 votes

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

System.out.println("enter the minutes:");

double minutes = sc.nextDouble() ;

double hours = minutes / 60;

System.out.println(" total no of hours are " + hours);

double days = hours/24;

System.out.println("total no of days are :" + days);

}

}

public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

System.out.println("enter the minutes:");

double minutes = sc.nextDouble() ;

double hours = minutes / 60;

System.out.println(" total no of hours are " + hours);

double days = hours/24;

System.out.println("total no of days are :" + days);

}

}

...