Answer:
Here are the if/elif statements:
if tomatoes == 24: #if farmer sells exactly two dozen tomatoes
watermelons +=4 #farmer receives 4 watermelons
elif tomatoes >= 12: #else farmer sells at least a dozen tomatoes
watermelons +=2 #farmer receives 2 watermelons
else:
tomatoes<12 #On the days that farmer sells less than a dozen tomatoes
apples +=1 #farmer will get a single apple
Explanation:
You can test the working of these if elif statements by this program:
tomatoes = int(input("Enter the amount of tomatoes sold: ")) #prompts user to enter number of tomatoes
watermelons = 0 #initialize watermelons value to 1
apples = 0 #initialize apples value to 1
if tomatoes == 24:
watermelons +=4
elif tomatoes >= 12:
watermelons +=2
else:
tomatoes<12
apples +=1
print("Number of watermelons recieved: ",watermelons) #displays the received number of watermelons
print("Number of apples recieved: ",apples ) #displays the received number of apples