Answer:
The following includes the explanation, code, and resulting outputs.
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 challenge involved displaying feature messages for a car based on its model year.
Logical conditions were integrated into the coding. The implementation has been verified with multiple inputs producing the expected 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.