Shitty Java Programs -> Fucking ENTERPRISE programs that are fast, accurate and robust, like a Spartan.
* Ask user the time in hours, minutes, seconds
* Convert to seconds and output
Name:
Anonymous2007-11-11 19:32
Do your own homework
Name:
Anonymous2007-11-11 19:34
Scanner reader = new Scanner(System.in);
System.out.print("Hours?");
int hours = reader.nextInt();
System.out.print("Minutes?");
int minutes = reader.nextInt();
System.out.print("Seconds?");
int seconds = reader.nextInt();
long result = hours * 3600 + minutes * 60 + seconds;
System.out.print("Result = " + result);
I win.
Name:
Anonymous2007-11-11 19:53
I could do this in both C and Lisp and I know neither.
Name:
Anonymous2007-11-11 20:17
>>3
negatives shouldn't be valid, and you're not parsing the user's input >>4
that's why it's called shitty
Name:
Anonymous2007-11-11 20:32
you're not parsing the user's input
I think he needs to write the user input format in BNF, convert that to YACC syntax and use BYACC/J to create a parser.
Name:
Anonymous2007-11-12 1:23
A (working) ENTERPRISE version can be made available but I can't be fucked.
Name:
Anonymous2007-11-12 1:31
I CAME
Name:
Anonymous2007-11-12 4:18
Shitty shit
Name:
Anonymous2007-11-12 5:00
>>1
Enterprise and Spartan are opposites. Spartan means simple, uncluttered, robust, and getting the job done. Enterprise means overcomplicated, overengineered, bloated, weak, bland, and failure.
Name:
Anonymous2007-11-12 15:52
>>10
then it describes java perfectly...exactly the opposite of how its creators say it is.
Name:
Anonymous2007-11-12 16:16
Im pretty sure that can be done in a 1 liner.
convert the input into a date/time object, then print numseconds since the epoch or somesuch.
The only way to create like a programmer if you use my name OR I WILL now proceed to enter a critical competitive advantage and taking them to total at the HIGHEST VALUE AND the number of something true and 0 otherwise But.