CHALLENGE ACTIVITY 4.7.2: If-else statements. 454192.2153518.qx3zqy7 Jump to level 1 Write multiple if statements: If car_year is before 1968, 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 2000, print "Probably has airbags." End each phrase with period and newline. Remember that print() automatically adds a newline. Ex: car_year 1995 prints: Probably has head rests. Probably has anti-lock brakes. 1 car_year= int (input()) 2 3 if car _year <= 1968: 4 print (Probably has few safety features., end='') 5 6 if car_year > 1971: 7 8 9 10 if car_year > 1992: 11 print (Probably has head rests., end='') print (car_year) print (Probably has anti-lock brakes., end='') 12 13 if car_year > 2000: 14 15 16 print (Probably has airbags., end='') D D-D“
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
I Need Question Help With This Problem. This is If-else statement problem. Program using is Python. Thanks.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images