Code:
#include <iostream>
using namespace std;
int main()
{
int Car_Year;
cout<<"Please Enter the Car Model."<<endl;
cin>>Car_Year;
if (Car_Year<1967)
{
cout<<"Few safety features."<<endl;
}
else if (Car_Year>1971 && Car_Year<=1991)
{
cout<<"Probably has head rests."<<endl;
}
else if (Car_Year>1991 && Car_Year<=2000)
{
cout<<"Probably has antilock brakes."<<endl;
}
else if (Car_Year>2000)
{
cout<<"Probably has airbags."<<endl;
}
else
{
cout<<"Invalid Selection."<<endl;
}
return 0;
}
Output:
Please Enter the Car Model.
1975
Probably has head rests.
Please Enter the Car Model.
1999
Probably has antilock brakes.
Please Enter the Car Model.
2005
Probably has airbags.
Please Enter the Car Model.
1955
Few safety features.
Explanation:
We were required to implement multiple If else conditions to assign car model year with the corresponding features of the car.
The code is tested with a wide range of inputs and it returned the same results as it was asked in the question.