**Please the code is supposed to output time in Hours, minutes and seconds when a value is entered into the prompt...please tell me what i am doing wrong in the code where there is an asterisk
import java.util.Scanner;
public class Person {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.print("Please enter any number > ");
double time_Input = keyboard.nextDouble();
int numberOfHours = (int) time_Input / 60;
int numberOfMinutes = (int) (time_Input % 60);
double numberOfMinutes1 = time_Input % 60;
double numberOfSeconds = numberOfMinutes1 % numberOfMinutes ;
if (time_Input>0 && time_Input<999999999)
{
System.out.printf("Time is: %d Hours, %f Minutes, and %f Seconds", numberOfHours, numberOfMinutes1, numberOfSeconds); *****something is wrong here
}else {
System.out.println("NaN");
}
}
}
import java.util.Scanner;
public class Person {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.print("Please enter any number > ");
double time_Input = keyboard.nextDouble();
int numberOfHours = (int) time_Input / 60;
int numberOfMinutes = (int) (time_Input % 60);
double numberOfMinutes1 = time_Input % 60;
double numberOfSeconds = numberOfMinutes1 % numberOfMinutes ;
if (time_Input>0 && time_Input<999999999)
{
System.out.printf("Time is: %d Hours, %f Minutes, and %f Seconds", numberOfHours, numberOfMinutes1, numberOfSeconds); *****something is wrong here
}else {
System.out.println("NaN");
}
}
}