Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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: Probably has seat belts. Probably has anti-lock brakes. public class CarFeatures { public static void main (String [] args) { int carYear = 0: carYear = 1940: if(carYear lessthanorequalto 1969) { System.out.println("Probably has few safety features."): } else if (carYear greaterthanorequalto 1970) { System.out.println("Probably has seat belts."): } else if (carYear greaterthanorequalto 1990) { System.out.println("Probably has anti-lock brakes."): } else if (carYear greaterthanorequalto 2000) { System.out.println("Probably has air bags."): } return: } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started