154k views
5 votes
Write a conditional statement that decreases the variable shelflife by 4 if the variable outsidetemperature is greater than 90?

User Cedersved
by
9.0k points

1 Answer

0 votes

Final answer:

A conditional statement to decrease 'shelflife' by 4 if 'outsidetemperature' is greater than 90 can be written in Python as: if outsidetemperature > 90: shelflife -= 4.

Step-by-step explanation:

To write a conditional statement that decreases the variable shelflife by 4 if the variable outsidetemperature is greater than 90, you can use a simple if statement in most programming languages. Here's an example in Python:

if outsidetemperature > 90:
shelflife -= 4

This statement checks whether outsidetemperature is greater than 90. If it is, the statement shelflife -= 4 will execute, effectively reducing the shelflife by 4.

User Jenyffer
by
8.2k points