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

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.

answered
User Jenyffer
by
8.0k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.