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

Pages: 1-

i love you

Name: Anonymous 2009-03-17 17:54

//validates if the guess is a valid guess in length
while (SecretCodeDigits == 5 && (userGuess < 10000 && userGuess > 99999)|| (SecretCodeDigits == 4 && (userGuess < 1000 && userGuess > 9999))||(SecretCodeDigits == 3 && (userGuess < 100 && userGuess > 999)));
//excessively long condition                    {
                        System.out.println("please enter a valid guess that is " + SecretCodeDigits + " digits long.");
int userGuess = keyboard.nextInt();
}

It says i have a duplicate local variable for "userGuess".
how can i fix this?

Name: Anonymous 2009-03-17 17:56

how can i fix this?
Remove it.

Name: Anonymous 2009-03-17 17:58

int userGuess=0;
while (1) {
userGuess = 1;
}

I skipped a bunch of your shit.

Name: Anonymous 2009-03-17 18:14

edited for clarity

int userGuess = keyboard.nextint();
while (condition is true){
     println userGuess is invalid
     prompt user for userGuess that is valid
}

i have a duplicate variable for userGuess

Name: Anonymous 2009-03-17 18:15

STOP BRING YOUR COMPUTER SCIENCE 101 SHIT TO /PROG/.  WE ARE EXPERT PROGRAMMERS!

Name: Anonymous 2009-03-17 18:18

i have a duplicate variable for userGuess

I think you solved your own problem, dumbass.

Name: Anonymous 2009-03-17 18:27

should we help him?

Name: Anonymous 2009-03-17 18:28

         ,. -───-- 、_
      rー-、,.'"          `ヽ、.
      _」::::::i  _ゝへ__rへ__ ノ__   `l
     く::::::::::`i / ゝ-'‐' ̄ ̄`ヽ、_ト-、__rイ、
      \::::::::ゝイ,.イノヽ! レ ヽ,_`ヽ7ヽ___>
      r'´ ィ"レ´ へ ,___, へ  `!  i  ハ
      ヽ/ ! /// (_,| /// i  ハ   ',  yu~ yu~ sage it easy
      .ノ /l       |    ハノ i  ヽ.
      〈,.ヘ ヽ、        〈 i  ハ  i  〉
       ノ レ^ゝi>.、.,_____,,...ィ´//レ'ヽハヘノ
         /⌒`γ´ハ_,,.イ´レ`ヽ、  /⌒ヽ、
        〈r'^ヽi /^L_!ムイ_」^ヽ. .〉´ /  i' \
           `7 _ノ'§ !、_  !,イ__'⌒ヽ、ノ   i
           i、_ノ !、,§__、ハ、_ノ、/、__  ⌒ヽノ
            r/ `ー--─ヘ´``ヽ、_イ
            /  /       ',  ヽ、 >、
          rく__       ハ  ゝイン
           `'、__ニ、_r_、_イ__r__ェ_'ン´.......
          ::::::::::i__,7:::::::::i,__,7::::::::::::::::::
           ::::└'゙::::::::::::i,_,/::::::::::

Name: Anonymous 2009-03-17 18:30

>>7
yeah i think we should help OP but i don't know how so someone else tell me.

Name: Anonymous 2009-03-17 19:32

>>9
Somebody gave him a fully fledged java program yesterday, given an arm and now he is asking for a leg.

Name: Anonymous 2009-03-17 19:39

hate you cunts thik it's all gv fuckig mfkr fjj then all tghao phappenin tih teh ufckn kkjng vutcjh iI can;t ajemevje putuiis piss rtimbmn

Name: Anonymous 2009-03-17 19:57

>>9
Hello OP.  Come back for more, eh?

Name: Anonymous 2009-03-17 20:04

while();{}

Hahahahahahaha

Name: Anonymous 2009-03-17 20:11

Jesus fucking Christ. >>3 already solved your problem, but since you're apparently a dense faggot:

while (SecretCodeDigits <= 5 && SecretCodeDigits => 3) {
    System.out.println("Please enter a valid guess that is " +
                       SecretCodeDigits + " digits long.");
    userGuess = keyboard.nextInt();
}


Note what's been fixed:

1. Your condition was retarded. >>3's optimisation was probably too optimistic, so mine is exactly equivalent except not dumb.

2. You had a semicolon after your while(). Infinite loops aren't fun for anyone, asshole.

3. I capitalised ``please''. Not related to the code, just common fucking courtesy.

4. The thing the compiler complained about: you redeclared userGuess when you clearly already had a variable named that, as evidenced by the fact you used it in your condition.

I did not fix the problem that your code doesn't actually do what the comment says it does. I assumed you just suck at writing comments, so I removed it.

And fuck you for using Java.

Name: >>14 2009-03-17 20:15

>>14
You know what, I'm totally wrong about the condition. >>1 is even dumber than I assumed it would be after glancing over it.
Never fucking mind. You don't deserve help.

Name: Anonymous 2009-03-17 20:22

Name: Anonymous 2009-03-17 21:01

op here i only posted >>1 and >>4

Name: Anonymous 2009-03-17 21:09

>>14
YOU HELPED HIM!!!

Name: Anonymous 2009-03-17 22:06

>>18
SO WHAT!? WHO CARES!

Name: Anonymous 2009-03-17 22:45

>>19
[b][i]Doesn't get /prog/

Name: Anonymous 2009-03-17 22:51

>>20
EXPERT BBCODE PROGRAMMER

Name: Anonymous 2009-03-18 6:07

Resurrection bump

Name: Anonymous 2009-03-18 13:27

Tell me anon, why does this java code not work?

double pounds = ((euros / 1.46859) && (dollars / 1.88732));

Name: Anonymous 2009-03-18 13:29

>>23
wtf?

Name: Anonymous 2009-03-18 13:29

>>23
You can't cast a boolean to a double.

Name: Anonymous 2009-03-18 13:37

>>25

So how would you do a statement like that then?

needing one value in an if statement i.e. 'pounds' to change according to the values in the gui (euros or dollars)

Name: Anonymous 2009-03-18 13:46

>>24

wtf?

Name: Anonymous 2009-03-18 13:47

>>26
double pounds = ((euros / 1.46859) && (dollars / 1.88732)) ? 1 : 0;

Name: Anonymous 2009-03-18 13:54

>>28

Same error occured, I also get an error from the compiler from this line of code

' public class GuiProgram extends JFrame implements    ActionListener'

Saying 'GUI program is not abstract and does not override abstract method actionPerformed (java.awt.event.ActionEvent) in java.awt.event.ActionListener

Name: Anonymous 2009-03-18 15:13

>public class GuiProgram
EXPERT NAMING CONVENTIONS

Name: Anonymous 2009-03-18 16:38

>>30

It's for a set homework you sack of shit. Anyway that's all solved, so /thread.

Name: Anonymous 2009-03-18 16:56

>>31
Good riddance.

Name: Anonymous 2010-11-28 1:11


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