Answer:
Explanation along with code and output results is provided below.
C++ Code:
#include <iostream>
using namespace std;
int main()
{
int year;
cout<<"Enter the car model year."<<endl;
cin>>year;
if (year<=1969)
{
cout<<"Few safety features."<<endl;
}
else if (year>=1970 && year<1989)
{
cout<<"Probably has seat belts."<<endl;
}
else if (year>=1990 && year<1999)
{
cout<<"Probably has antilock brakes."<<endl;
}
else if (year>=2000)
{
cout<<"Probably has airbags."<<endl;
}
return 0;
}
Explanation:
The problem was to print feature messages of a car given its model year.
If else conditions are being used incorporate the logic. The code has been tested with several inputs and got correct output results.
Output:
Enter the car model year.
1961
Few safety features.
Enter the car model year.
1975
Probably has seat belts.
Enter the car model year.
1994
Probably has antilock brakes.
Enter the car model year.
2005
Probably has airbags.