I am having trouble correctly formatting my code I keep gett

I am having trouble correctly formatting my code. I keep getting this error in the photo below. What change do I make to correct this?

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.


import java.util.Scanner;

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

carYear = 1940;
  
if(carYear <= 1969){
System.out.print(\"Probably has few safety features.\");
}
System.out.print(\"\");
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.\");
}
return;
}
}

Solution

Hi,

I have mode changes for this formatting issues. Please find the below updated code and highighted the code changes.

public class CarFeatures {

public static void main (String [] args) {

int carYear = 0;

carYear = 1940;

  

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.\");

}

return;

}

}

I am having trouble correctly formatting my code. I keep getting this error in the photo below. What change do I make to correct this? Write multiple if stateme
I am having trouble correctly formatting my code. I keep getting this error in the photo below. What change do I make to correct this? Write multiple if stateme

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site