import java.util.Scanner; public class Seconds { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub // Variable declarations int hours, mins, secs, totalsecs; Scanner in = new Scanner(System.in); // Prompt user and read in values System.out.print("Enter the number of hours:"); hours = in.nextInt(); System.out.print("Enter the number of minutes:"); mins = in.nextInt(); System.out.print("Enter the number of seconds:"); secs = in.nextInt(); // Calculate and display total number of seconds totalsecs = (hours * 3600) + (mins * 60) + secs; System.out.println("Total seconds: " + totalsecs); } }