Clunker Motors Inc is recalling all vehicles in its Extravag

Clunker Motors, Inc. is recalling all vehicles in its Extravagant and from model years 1999-2002 well all vehicles in Guzzler line from model years 2004-2007. A bool named recalled and been into as that assigns true to recalled the Values model year and model Name match the recall assigns true see otherwise. values Year and string mode Name write a statement Do not use an statement in this eeriest.

Solution

I have written a c++ program with the desired statement. Here we have used conditional operator in place of if condition.

#include<iostream>
using namespace std;

int main()
{
   //variable decleration
   bool recalled;
   int modelYear = 1999;
   string modelName = \"Extravagant\";
  
   //conditional operator is used to set the bool value on the bases of condition
   //Not used if, here we have used conditional operator
   recalled = (((modelYear>= 1999 && modelYear <=2000) && (modelName == \"Extravagant\") || (modelYear>= 2004 && modelYear <=2007) && (modelName == \"Guzzier\") ) ? true: false);
   cout<<recalled;
  
}

 Clunker Motors, Inc. is recalling all vehicles in its Extravagant and from model years 1999-2002 well all vehicles in Guzzler line from model years 2004-2007.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site