Ask Question

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.

+1
Answers (1)
  1. 4 July, 18:40
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers