Write multiple if statements If carYear is 1969 or earlier p

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:

Solution

CarFeatures.java


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;

   }

}

Output:

Probably has few safety features.

Write multiple if statements. If carYear is 1969 or earlier, print \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site