194k views
1 vote
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.

1 Answer

6 votes

Answer:

Step-by-step explanation:

In C++ language the program would be

#include <iostream>

using namespace std;

int main(){

int input = 0;

cin >>input>>;

if( input < 1969 ){

cout << "Few safety features."<<endl;

} else if(input < 1990){

cout << "Probably has seat belts."<<endl;

} elseif (input < 2000){

cout << "Probably has antilock brakes."<<endl;

}else {

cout << "Probably has airbags."<<endl;

}

return 0;

}

User PedroZorus
by
8.4k points