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

Pages: 1-

JAVA SHITTY CHALLENGES

Name: Anonymous 2007-11-11 19:27

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: Anonymous 2007-11-11 19:32

Do your own homework

Name: Anonymous 2007-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: Anonymous 2007-11-11 19:53

I could do this in both C and Lisp and I know neither.

Name: Anonymous 2007-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: Anonymous 2007-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: Anonymous 2007-11-12 1:23

A (working) ENTERPRISE version can be made available but I can't be fucked.

Name: Anonymous 2007-11-12 1:31

I CAME

Name: Anonymous 2007-11-12 4:18

Shitty shit

Name: Anonymous 2007-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: Anonymous 2007-11-12 15:52

>>10
then it describes java perfectly...exactly the opposite of how its creators say it is.

Name: Anonymous 2007-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.

Name: Anonymous 2007-11-13 14:10

Spartans would do it in Assembly.

Name: Anonymous 2007-11-13 15:33

>>1
Java? This is SPARTAAAAAAAAAAAAAAAAA!!

Name: Anonymous 2007-11-13 18:30

>>13
and sweaty hot man bumsex after 100000 lines just to copy from one i/o port to another

Name: Anonymous 2007-11-13 19:24


print <STDIN> * 3600 + <STDIN> * 60 + <STDIN>, "\n";

Name: Anonymous 2009-03-06 6:54


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.

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