18.8k views
3 votes
Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. Given a variable modelYear write a statement that prints the message "RECALL" to standard output if the value of modelYear falls within that range.

User Yuva
by
5.1k points

1 Answer

6 votes

Answer:

Using Java:

if ((modelYear >= 2001) && (modelYear <= 2006)) {

System.out.println("RECALL");

}

Step-by-step explanation:

Assumption: the variable modelYear is given, it is an integer and exists in memory.

User Robert Kubrick
by
4.7k points