Ask Question

Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 1971, print "Probably has head rests.". If after 1990, print "Probably has electronic stability control.". If after 2000, print "Probably has airbags.". End each phrase with period and newline. Ex: carYear = 1995 prints: Probably has head rests. Probably has electronic stability control.

+4
Answers (1)
  1. 2 July, 09:14
    0
    carYear=int (input ("What year was your car produced: "))

    if carYear < 1968:

    print ("Probably has few safety Features./n")

    if carYear > 1971:

    print ("Probably has head rests./n",)

    if carYear > 1990:

    print ("Probably has electronic stability control./n")

    if carYear > 2000:

    print ("Probably has airbags./n")

    Explanation:

    carYear=int (input ("What year was your car produced: "))

    - prompts the user to input a year and converts it to an integer (only integers or floats can be used with operators like. A year cannot be a float because it's a whole number.

    if carYear < 1968:

    print ("Probably has few safety Features./n")

    -If carYear is before 1968, i. e. if car year is less than 1968

    Output/print/display Probably has few safety Features

    "/n" is used to create a new line

    if carYear > 1971:

    print ("Probably has head rests./n",)

    -If after 1971, i. e. if car year is greater than 1971

    Output/print/display Probably has head rests

    "/n" is used to create a new line

    if carYear > 1990:

    print ("Probably has electronic stability control./n")

    -If after 1990, i. e. if car year is greater than 1990

    Output/print/display Probably has electronic stability control

    "/n" is used to create a new line

    if carYear > 2000:

    print ("Probably has airbags./n")

    -If after 2000, i. e. if car year is greater than 2000

    Output/print/display Probably has airbags

    "/n" is used to create a new line
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write multiple if statements: If carYear is before 1968, 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