Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (marks != -1) {
- do {
- try {
- marks = reader.nextInt();
- }
- catch (InputMismatchException e)
- {
- marks = 1000;
- continue;
- }
- if (marks == -1) {
- total++;
- } else {
- System.out.println("Invalid input please enter 0-100");
- }
- }while (marks < -1 || marks > 100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement