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

How do I do this in java...?

Name: newfag 2008-02-06 11:02

  //grading
  float grade = -1.0F;
  do {
    System.out.print("Input your grade: ");
    grade = grade.nextFloat();
    if (grade < 0.0F || grade > 1.5F) {
      System.err.println("Error: The grade must be between 0.0 and 1.5!");
    }
  } while (grade < 0.0F || grade > 1.5F);

It's done, but I want it to deal with some cases, like... if the guy inputs a name or something... is it possible to this in java?

thanks

Name: Anonymous 2008-02-06 11:56

>>1
grade = grade.nextFloat();
wat

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