Write multiple if statements. If car_year is 1969 or earlier, print "Few safety features." If 1970 or later, print "Probably has seat belts." If 1990 or later, print "Probably has antilock brakes." If 2000 or later, print "Probably has airbags." End each phrase with a period and a newline. Sample output for input: 1995

Respuesta :

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.

ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE