Important Information for Revel Exercises

Note: You can get the hints for selected quizzes and programming projects from https://liveexample.pearsoncmg.com/java13e.html for the new Java 13 Revel and


https://liveexample.pearsoncmg.com/javarevel2e.html for the old Java 12 Revel .


Note: For all programming projects, the numbers should be double unless it is explicitly stated as int. If you get a java.util.InputMismatchException error, check if your code used input.nextInt(), but it should be input.nextDouble(). For integers, use int unless it is explicitly stated as long.

NOTE: Revel assigned exercises are currently submitted to a Java 11 compiler. Use the CheckExercise tool from https://liveexample.pearsoncmg.com/CheckExercise/faces/CheckExercise13e.xhtml to automatically check your code for logic errors before submitting to Revel.

Errata for the 13e Errata can be viewed at https://liveexample.pearsoncmg.com/erratajava13e.html.
If you find or suspect any errors, please email Dr. Liang (y.daniel.liang@gmail.com). Thank you.

Q1: Why does each programming project have a designated class name?

A: A Java program is a Java class. A class has a name. The class name must match a file name. For example, for Chapter 1 Programming Project 1, the class name is Exercise01_01. The underlying file name for the class is Exercise01_01.java. Revel will store your class to Exercise01_01.java. If your class name is spelled wrong, you will get a compile error. You have to spell the class name exactly as Exercise01_01. The name such as exercise01_01, Exercise1_1, or Exrecise01_01 would be wrong.

Q2: My code is correct, but Revel says it is wrong without giving any reasons. What can I do?

A: First, check if your code contains System.exit(int). Revel assigned exercises cannot handle it at this time. So please replace it with return. Your code will run just fine after this replacement.

If it is a programming project at the end of the chapter, you can use the CheckExercise tool from https://liveexample.pearsoncmg.com/CheckExercise/faces/CheckExercise13e.xhtml to diagnose the code. The tool gives you the diagnostic messages to help you debug the errors. Each programming project has a class name. The class name is an exercise name in the CheckExercise tool.

If your programming project passed Automatic Check in the CheckExercise tool, but failed in Revel, email Dr. Liang (y.daniel.liang@gmail.com) a screen shot of the submission on Revel, the source code, and a brief description. We will reply in 24 hours. Thank you for helping us improve the book.

For a quiz under a section, if you think your code is correct, but Revel says it is wrong without giving a good reason, email Dr. Liang (y.daniel.liang@gmail.com) a screen shot of the submission on Revel, the source code, and a brief description. We will reply in 24 hours. Thank you for helping us improve the book.

Q3: My program runs fine outside of Revel, but when running from Revel, it throws java.util.NoSuchElementException. How do I fix it?

A: It is likely that new Scanner(System.in) is executed multiple times in your code. You should make it to execute only once. See Common Pitfall 1: Redundant Input Object at the end of Section 2.19 for a fix.

Click here for Revel Videos for instructors and students.