Question: hello~ I am currently trying to make a simple Java program that accepts a number of minutes and converts it to both hours and days,
hello~ I am currently trying to make a simple Java program that accepts a number of minutes and converts it to both hours and days, but one specific line is killing me, line 12.
import java.util.Scanner; public class MinutesConversion { public static void main(String[] args) { // write your program's code here final int MINUTES_PER_DAY=1440; final int ONE_HOUR=60; Scanner scanner=new Scanner(System.in); int minutes; System.out.println("Enter number of minutes:"); minutes = scanner.nextln(); int hours=minutes/ONE_HOUR; double days=(double)minutes/MINUTES_PER_DAY; System.out.printf("%d minutes equals %d hours and equals %.3f days.",minutes,hours,days); } }
The line is "minutes = scanner.nextln();" can someone please tell me whats wrong?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
