Search:

Type: Posts; User: camel-man

Page 1 of 6 1 2 3 4

Search: Search took 0.24 seconds.

  1. Replies
    2
    Views
    60

    Re: Simple Random Dice Game

    when comparing values in Java (for strings) use the .equals method.

    example is
    if(answer.equals("YES"))
  2. Replies
    6
    Views
    106

    Re: Java classes static?

    I went from C to java, so no resources to learn. I've only looked at the API a couple times, didn't realize that it showed the way the class was defined. (I just assumed it was the method signatures).
  3. Replies
    6
    Views
    106

    Java classes static?

    How come you can refer to a class in java like this

    Arrays.sort(array);

    Arrays is a class. So does that mean that their methods are all declared as static since we do not have to create an...
  4. Re: How many beers does it take to become intoxicated?

    What's happening is that when you enter in, say an integer, you are typing in (example 56\n) the newline is when you hit enter. That new line is not recognized as an integer so it will stay in the...
  5. Re: How many beers does it take to become intoxicated?

    There is a newline being left in the buffer, each time go from asking for a double to asking for the name you need to flush the new line character. An easy way to do this is by inserting in a...
  6. Re: How many beers does it take to become intoxicated?

    One thing I noticed is that your method has a return type of void, yet you are trying to return a double.

    maybe try taking out the [] and putting in an extra () instead around [(0.08 + 0.015)]...
  7. Re: How many beers does it take to become intoxicated?

    what does the error say?
  8. Re: Cannot, for the life of me, find the problem with this class file. Any help is appreciated.

    Cannot, for the life of me , understand what "Cannot, for the life of me, find the problem with this class file" means...
  9. Replies
    8
    Views
    134

    Re: I would really appreciate your help!!!

    Start off with reading the text file. Give it a shot first, then come back with specific questions to your code.
  10. Replies
    3
    Views
    98

    Re: Please solve my Problem

    prompt user to enter in grades
    specify that A,B,C,D, F should be used

    Start with that, are you allowed to use arrays? That would be a good consideration for the student numbers/grades
  11. Re: Need help with creating array files and reading from them etc...

    All that does is set two integers to be the value of the 6th value in the ifile array.
  12. Re: Need help with creating array files and reading from them etc...

    If you're going to do it that way just remember, after you find the first highest number and you start to go back through the lists 4 more times, you will need to compare with the "fiveLargest" array...
  13. Re: Need help with creating array files and reading from them etc...

    You could sort the array then take the last 5 integers or first 5 (depending on how you sort).
  14. Replies
    1
    Views
    72

    [SOLVED] Re: Need help with a calculator program

    If you want doubles, look into using nextDouble(); method
  15. Re: Need help with creating array files and reading from them etc...

    When I run it, I get 12458564
    for the final total of all the numbers added up.

    does that look right to you?
  16. Replies
    7
    Views
    104

    [SOLVED] Re: String not being passed into method?

    Remember that your methods RETURN a string. You are just passing in the string and expecting it to change the value. You need to do something like plainText=sED.encode(plainText); as well as in this...
  17. Re: Need help with creating array files and reading from them etc...

    Everything looks right to me, I think what is happening is JGRASP's console isn't displaying all 5000. there might be a setting in there that will allow you to format it to keep up to 5000 lines in...
  18. Re: Need help with creating array files and reading from them etc...

    Are you reading the output from the console or from the results.txt file? Or both?

    Post your current code.
  19. Re: Need help with creating array files and reading from them etc...

    to make sure they are really spitting out correctly you should comment out the system.out.print(total); line and add in System.out.println(ifile[index]);

    This will help you see if the numbers are...
  20. Re: Need help with creating array files and reading from them etc...

    ifile[index] = fr.nextInt();

    is that what you are looking for?
  21. Replies
    2
    Views
    76

    Re: Why is this while loop not working??

    operator cannot be both less than 0 AND greater than 4.
  22. Re: Removing the enter key space after user input

    try putting another stdIn.nextLine(); after response = stdIn.nextLine(); just before the end of the loop
  23. Re: Constructor Arguments Error when Compiling

    you don't have a constructor in your Service class.

    public Service(parameters...) // this is what you should have

    you probably should change salonServices to just be public Service(//same...
  24. Replies
    4
    Views
    97

    Re: Tic Tac Toe game in NetBean

    one thing I noticed off the bat was this


    if (winner == 'O') {
    winner = NOUGHT;
    }
    if (winner == 'X') {
    winner = CROSS;
    }
  25. Re: How to determine value after nested for loop

    grab a piece of paper and write down count and all the other variables values and step through the code one step at a time.

    remember that this is a triple nested loop.
Results 1 to 25 of 135
Page 1 of 6 1 2 3 4