Usually there are many equivalent ways to write an if
statement.
Here is the original fragment, which uses AND:
if ( !(speed > 2000 && memory > 512) ) System.out.println("Reject this computer"); else System.out.println("Acceptable computer");
Here is an equivalent fragement that uses OR:
if ( speed <= 2000 || memory <= 512 ) System.out.println("Reject this computer"); else System.out.println("Acceptable computer");
Yet another equivalent fragment reverses the order of the true and false branches of the statement:
if ( speed > 2000 && memory > 512 ) System.out.println("Acceptable computer"); else System.out.println("Reject this computer");
The last fragment is probably the best choice because it is the easiest to read. It follows the form:
if ( expression that returns "true" for the desired condition ) perform the desired action else perform some other action
Generally, people find statements that involve NOT to be confusing. Avoid using using NOT, if you can. If NOTs are needed, try to apply them to small subexpressions, only.
Rewrite the following natural language statment into an equivalent easily understood statement.
It is not true that lack of study does not result in failure in a course.