Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-2006. Given a variable modelYear write a statement that prints the message “RECALL” to standard output if the value of modelYear falls within those two ranges.
LANGUAGE: C++
CHALLENGE:
Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-2006. Given a variable modelYear write a statement that prints the message “RECALL” to standard output if the value of modelYear falls within those two ranges.
SOLUTION:
if((modelYear > 1994 && modelYear < 1999 )||(modelYear > 2003 && modelYear < 2007 )){ cout << "RECALL"; }else{ }