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.
.
.
Click on the title for the solution
.
.
.
Click on the title for the solution
.
.
This is the answer:
:
if (modelYear>=1995 && modelYear<=1998 || modelYear>=2004 && modelYear<=2006) cout<<"RECALL";
Comments
Post a Comment