Ask Question
11 November, 05:57

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.

+4
Answers (1)
  1. 11 November, 08:24
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers