A good answer might be:

if (  speed <= 2000  ||  memory <= 512 )
  System.out.println("Reject this computer");
else
  System.out.println("Acceptable computer");

The following is a more natural way to write this code fragment:

if (  speed > 2000  &&  memory > 512 )
  System.out.println("Acceptable computer");
else
  System.out.println("Reject this computer");

End of the Chapter

That is the end of this chapter. If (you are a good student) or (you are interested) you may wish to review the following.



Click here     Back to the main menu.

You have reached the end of the chapter.