Question: Part 2 : 1. Modify the program to read user input for carYears 2. Write multiple if statements. If carYear is 1969 or earlier, print

Part 2 :

1. Modify the program to read user input for carYears 2. 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." 3. End each phrase with period and move the cursor to a newline.

Ex: carYear = 1995 prints: Probably has seat belts. Probably has anti-lock brakes.

import java.util.Scanner;

public class CarFeatures { public static void main (String [] args) { int carYear = 0;

carYear = 1940;

/* Your solution goes here */

return; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!