/prog/ for the life of me I fucking fail at programming and my programming class. Anyone who can do this wins 1000 internets, and its not just a sham like all those other times people claim you can win internets.
PartII and III confuse the shit out of me and well i'll probably fail the class.
in b4 fucking fail, and fails for doing java
Name:
Anonymous2007-03-05 23:01 ID:/zwcVseO
Fail for trying to get /prog/ to do your homework for you.
Part I: Gay as shit, but whatever. You got that, apparently, I won't say anything else, but PROTIP: while loops and System.err are your friends. None of this try-catch-finally bullshit. zOMG MAH USER MAED A TYPO BETTAR TURN OFF TEH PROGRAM!!1
Part II: Write the UnaryStarSystem class with the methods EXACTLY as described in the API. After you do that you'll want something like private int getNumPlanets() { for (Planet p : ArrayList<Planet>) a++; return a; }
Don't copypasta that code, because I'm 100% sure it's not correct. But you get the idea: count the number of planets, return that, store it in a variable in whatever function called getNumPlanets. Good happy success.
To sort, just copypaste a binary-sort algorithm into a private method and be happy.
Part III: Write another class that performs operations on the UnaryStarSystem (fuck Java and making me type out those long fucking class names all the time, ClassNamesShouldNotBeAnEntireSentenceDammit()) using the built-in methods. Because God knows, if we want to change a variable WE CAN'T TOUCH THE VARIABLE OH MY GOD USE THESE METHODS WE WROTE WE HAVE TO HIDE THE IMPLEMENTATION FROM THE USER IT COULD KILL THEM AAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHH!!! It isn't really that hard.
Name:
Anonymous2007-03-05 23:14 ID:1eIGzp3E
Part I: Add throws clauses to the methods in the existing files, use an appropriate exception class, and update the javadoc comments. If you can't do this, give up now.
Part II: What he said, but ArrayList has a .size() method which makes manual counting pointless. In dumb-dumb language: here's some function signatures for a class. Write the functions in the class lol. If you can't do this, kill yourself.
Part III: Make a class to test the other class you just wrote. Instructions are so straightforward it ain't funny.
Everything you need is there on the page, or linked from it. Any other little things can be found in the Java API reference. I'm not linking it because if you can't find stuff for yourself, stay the hell out of /prog/.
Name:
Anonymous2007-03-05 23:16 ID:1eIGzp3E
Also, you fail at reading instructions, maybe you hit your head as a baby. Just a hint for eval question number 1.