Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

java help for beginners

Name: Anonymous 2009-02-08 18:18

Compute the remainder of seconds entered by the user by the number of seconds
in an hour (SECONDS_X_MINUTE).


import java.util.Scanner;

public class Time {

    public static final int SECONDS_X_HOUR = 3600;
    public static final int SECONDS_X_MINUTE = 60;
    public static final int AM_PERIOD = 43199;
    public static void main(String[] args) {
   
        int timeInSeconds;
        int timeInHours;
        int remainderHours;
        int timeInMinutes;
        int standardTimeInHours;
       
        Scanner keyboard = new Scanner(System.in);
        System.out.println ("Please Enter Time in Seconds :\t");
        timeInSeconds = keyboard.nextInt();
        timeInHours = timeInSeconds/SECONDS_X_HOUR;   
        remainderHours = timeInHours&SECONDS_X_HOUR;
        timeInMinutes = remainderHours * SECONDS_X_MINUTE;
       
       
        System.out.println (timeInSeconds + " " + timeInHours + " " + remainderHours + " " +timeInMinutes);
        System.out.println ("Please enter the time in seconds: " + timeInSeconds);
        System.out.println ("Standard Format: " + (int)timeInHours + "h. " + timeInMinutes + "m. " + timeInSeconds + "s.");
        System.out.println ("AM/PM Format: " + timeInHours + "h. " + timeInMinutes + "m. " + timeInSeconds + "s.");


    }

}

Name: Anonymous 2009-02-09 14:02

>>23
pyth a b = sqrt . foldl (+) 0 $ map (**2) [a, b]

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List