Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. Given a variable modelYear write a statement that prints the message “NO RECALL” to standard output if the value of modelYear DOES NOT fall within that range.

LANGUAGE: JAVA

CHALLENGE:

Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. Given a variable modelYear write a statement that prints the message “NO RECALL” to standard output if the value of modelYear DOES NOT fall within that range.

SOLUTION:

LANGUAGE: JAVA

CHALLENGE:

Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. Given a variable modelYear write a statement that prints the message “NO RECALL” to standard output if the value of modelYear DOES NOT fall within that range.

SOLUTION:

if (modelYear < 2001 || modelYear > 2006)
System.out.println("NO RECALL");