Ask Question
19 August, 04:10

Write multiple if statements: If carYear is before 1967, print "Probably has few safety features." (without quotes). If after 1971, print "Probably has head rests.". If after 1992, print "Probably has anti-lock brakes.". If after 2002, print "Probably has tire-pressure monitor.". End each phrase with period and newline. Ex: carYear = 1995 prints: Probably has head rests. Probably has anti-lock brakes.

+3
Answers (1)
  1. 19 August, 04:45
    0
    public class Main

    {

    public static void main (String[] args) {

    int carYear = 1995;

    if (carYear < 1967)

    System. out. println ("Probably has few safety features.");

    if (carYear > 1971)

    System. out. println ("Probably has head rests.");

    if (carYear > 1992)

    System. out. println ("Probably has anti-lock brakes.");

    if (carYear > 2002)

    System. out. println ("Probably has tire-pressure monitor.");

    }

    }

    Explanation:

    The code is in Java.

    Initialize the carYear

    Use if statements to handle year before 1967, after 1971, after 1992 and after 2002.

    Print the required message for each if statement
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write multiple if statements: If carYear is before 1967, print "Probably has few safety features." (without quotes). If after 1971, print ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers