Search:

Type: Posts; User: javapenguin

Search: Search took 0.10 seconds.

  1. Replies
    10
    Views
    3,440

    Re: Please, find my mistake

    It's a bit confusing as to what is what.

    grade should probably be an int. You're using it as an int everywhere else.

    Also, what if the input were all 100's, then you wouldn't have any...
  2. Replies
    10
    Views
    3,440

    Re: Please, find my mistake

    Is grade meant to be entered as a double, i.e. a decimal, or as an integer?

    double grade=1;
    grade = scan.nextInt();


    if it's a double, then a better way of putting that would be
    grade =...
  3. Replies
    10
    Views
    3,440

    Re: Please, find my mistake

    while (grade<=100 && grade > 0)

    This won't work if grade is 0 exactly.

    while (grade<=100 && grade >= 0)

    is better.


    This probably isn't going to be code that you can use directly,...
Results 1 to 3 of 3