Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 1999-2002 as well all vehicles in its Guz
zler line from model years 2004-2007. Given a variable modelYear and a String modelName write a statement that prints the message "RECALL" to standard output if the values of modelYear and modelName match the recall details.
if ((modelYear>=1999 && modelYear<=2002 && modelName=="Extravagant") || (modelYear>=2004 && modelYear<=2007 && modelName=="Guzzler")) // checking the condition
{
cout << "RECALL"; // display
}
Explanation:
Following are the description of Program
As mention in question "modelYear" is the variable of the int type and "modelName" is A String variable.
We check the condition in the if block.
In the IF block, it checks the condition with the OR(||) operator.
The condition is checking "modelYear" greater then or equal to 1999 and "modelYear" less then or equal to 2002 and "modelName" equal to "Extravagant" OR "modelYear" >= 2004 and "modelYear" <=2007 and "modelName" equal to Guzzler It print RECALL on the console window.