148k views
1 vote
Write multiple if statements. if caryear is 1969 or earlier, print "probably has few safety features." if 1970 or higher, print "probably has seat belts." if 1990 or higher, print "probably has anti-lock brakes." if 2000 or higher, print "probably has air bags." end each phrase with period and newline. ex: caryear = 1995 prints:

User Dbaugh
by
6.0k points

2 Answers

4 votes
if( caryear >= 2000 ):
print "probably has air bags.\\"
elif( caryear >= 1990 ):
print "probably has anti-lock brakes.\\"
elif( caryear >= 1970 ):
print "probably has seat belts.\\"
else:
print "probably has few safety features.\\"

User Jonathan Leon
by
6.6k points
1 vote

Answer:

if (carYear <= 1969) {

System.out.println("Probably has few safety features.");

}

if (carYear >= 1970) {

System.out.println("Probably has seat belts.");

}

if (carYear >= 1990) {

System.out.println("Probably has anti-lock brakes.");

}

if (carYear >= 2000) {

System.out.println("Probably has air bags.");

}

Step-by-step explanation:

User Mursalin
by
6.5k points