Question: **In JAVA, please. **I need help. I have the code but for some reason, it doesn't generate the code that I need. I have an

**In JAVA, please.

**I need help. I have the code but for some reason, it doesn't generate the code that I need. I have an example of the comparison on my output and the expected output for your perusal. If you can help that would be great.

Write multiple if statements:

If carYear is before 1967, print "Probably has few safety features." (without quotes).

If after 1971, print "Probably has seat belts.". I

f after 1991, print "Probably has anti-lock brakes.".

If after 2001, print "Probably has tire-pressure monitor.".

End each phrase with period and newline. Ex: carYear = 1995 prints:

Probably has seat belts. Probably has anti-lock brakes.

**My code:

if (carYear<1967) { System.out.println("Probably has few safety features."); } if (carYear>1971) { System.out.println("Probably has seat belts."); } if (carYear>1991) { System.out.println("Probably has anti-lock brakes."); } if (carYear>2001) { System.out.println("Probably has tire-pressure monitor."); }

**My output comparison

Output differs. See highlights below. Special character legend

Input

1966

Your output:

Probably has seat belts.

Probably has anti-lock brakes.

Expected output:

Probably has few safety features.

2: Compare output

keyboard_arrow_up

Output differs. See highlights below.

Input

1967

Your output:

Probably has seat belts. Probably has anti-lock brakes.

Expected output:

Solution expected no output

3: Compare output

keyboard_arrow_up

Output differs. See highlights below.

Input

1971

Your output:

Probably has seat belts. Probably has anti-lock brakes.

Expected output:

Solution expected no output

4: Compare output

keyboard_arrow_up

Output differs. See highlights below. Special character legend

Input

1972

Your output:

Probably has seat belts. Probably has anti-lock brakes.

Expected output:

Probably has seat belts.

5: Compare output

keyboard_arrow_up

Output differs. See highlights below. Special character legend

Input

1991

Your output:

Probably has seat belts. Probably has anti-lock brakes.

Expected output:

Probably has seat belts.

6: Compare output

keyboard_arrow_up

Input

1992

Your output

Probably has seat belts. Probably has anti-lock brakes.

7: Compare output

keyboard_arrow_up

Input

2001

Your output

Probably has seat belts. Probably has anti-lock brakes.

8: Compare output

keyboard_arrow_up

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!