Java Challenge 2 ? Sovle it
Grade { A { },
B, C, D};
public class EnumTest {
public static void main(String[] args)
{
Grade grade = ;
switch(grade) {
case __ :
System.out.println(grade);
default :
System.out.println("Default");
}
}
}
Code Hints : Enum
public String toString () { return "Book";}
return "Book"
"Book"
enum
A
Grade.A
--
Fill the underline code.
[477 byte] By [
Tatona] at [2007-10-3 2:11:59]

Probably best if you made an attempt at your own homework "challenges" first, eh?
@OP. You have already posted that question, and you were given a correct answer. Why are you posting it again?Kaj
kajbja at 2007-7-14 19:10:57 >

Ignore the spoilsports. I will do you homework for you but I will need time. When do you need it by?
By 2 days
Tatona at 2007-7-14 19:10:57 >

Some changes are there
Tatona at 2007-7-14 19:10:57 >

> By 2 daysOK - Wednesday 14:00 BST.
enum, "Book", Grade.A, A.I love providing answers for people that are too dumb to compile a few lines of code. (I don't care whether it's A, Grade.A or Grade.A, A).Can you say "would you like to add cheese"?
> XXXXXX Grade { A {XXXXXXXXXXX },
> B, C, D};
>
> public class EnumTest {
> public static void main(String[] args)
> {
> Grade grade = XXXXXXXXXXXX;
> switch(grade) {
> case XXXXXXXX :
> System.out.println(grade);
> default :
> System.out.println("Default");
> }
> }
> }
>
> Fill the underline code.
Done!
kind regards,
Jos
JosAHa at 2007-7-14 19:10:57 >

Taton seems to think s/he can actually get this done by posting the whole test here. Luser.%
> > Fill the underline code.> > Done!> > kind regards,> > JosWell done, but it looks like you weren't one of those artistic kids who used to color the whole paper. It's cowardly to stay within the lines
kajbja at 2007-7-14 19:10:57 >

> > > Fill the underline code.
> >
> > Done!
>
> Well done, but it looks like you weren't one of those
> artistic kids who used to color the whole paper. It's
> cowardly to stay within the lines ;)
That just shows my timid and shy little character ;-)
kind regards,
Jos (don't look at me *blush*)
JosAHa at 2007-7-14 19:10:57 >

> > By 2 days> > OK - Wednesday 14:00 BST.sabre will sort you out. Wait for it...%
> > > By 2 days
> >
> > OK - Wednesday 14:00 BST.
>
> sabre will sort you out. Wait for it...
>
> %
I got a weird idea. What if the OP actually installed a JDK and tried to compile the code? Would that be possible? Nah
kajbja at 2007-7-14 19:10:57 >

> I got a weird idea. What if the OP actually installed> a JDK and tried to compile the code? Would that be> possible? NahYou're crazy! What kind of nonsense is this?!
> > I got a weird idea. What if the OP actually installed
> > a JDK and tried to compile the code? Would that be
> > possible? Nah
>
> You're crazy! What kind of nonsense is this?!
All those Scandinavians must be smoking extremely funny cigarettes.
kind regards,
Jos ("trying to compile code" *giggle* ;-)
I've got the better idea for the OP: there are only seven distinct choices,
so there are only 7! ( == 5040) possible programs. Simply generate all
of them, save them to a temporary file (don't forget the ".java" extension)
and invoke javac on it. The first one that compiles cleanly is the
permutation of those seven choices that is correct.
kind regards,
Jos
ps. my 'rithmatic sucks big times ;-)
Message was edited by:
JosAH
> I've got the better idea for the OP: there are only
> seven distinct choices,
> so there are only 7! ( == 5040) possible programs.
> Simply generate all
> of them, save them to a temporary file (don't forget
> the ".java" extension)
> and invoke javac on it. The first one that compiles
> cleanly is the
> permutation of those seven choices that is correct.
Why do it the hard way? The OP is actually posting all possible combinations :)
http://forum.java.sun.com/thread.jspa?threadID=757833&messageID=4328923#4328923
> Why do it the hard way? The OP is actually posting
> all possible combinations :)
You mean we have to go through 5038 more of these?
kind regards,
Jos ;-)
ps. it's 'permutations' here, not 'combinations' (*)
(*) some nasty little nitpicker wrote this, not me, oh no Sir.
> ps. it's 'permutations' here, not 'combinations' (*)> > (*) some nasty little nitpicker wrote this, not me,> oh no Sir.Nah, it's all combinations for us who don't care about math :)
> I got a weird idea. What if the OP actually installed> a JDK and tried to compile the code? Would that be> possible? NahOr open a book?That's crazy talk.%