Two waiters at the restaurant want to be able to compare who hauled in more tips on a given evening. Normally, waiters keep 80% of their tips, but if they sell a special, they keep 100%.
Last night, Waiter A pulled in 150 dollars of tips on normal plates, and 50 dollars on specials. Waiter B collected 170 dollars on normal plates, and 30 dollars in specials.
Create a boolean variable,
waitera_win, that prints
True if waiter A collected more tips, and
False if waiter B collected more tips or if there was a tie.
# YOUR CODE HERE raise NotImplementedError() print(waitera_win)
### BEGIN TESTS assert waitera_win == True ### END TESTS
After using framework in exercise 1 to determine a nightly winner for a few weeks, the waiters want to modify the rules on specials to put an emphasis on selling specials.
If a waiter sells more specials than the other, they automatically win, otherwise, whoever collected the most tips on regular tables wins.
To test their formula, they used the values from the night in exercise 1, replacing the tips from the specials with the number of plates. On that night waiter A sold 6 special plates and waiter B sold 4.
Create a variable,
waitera_win_test that stores
True if waiter A won or there was a tie and
False if waiter B won.
# YOUR CODE HERE raise NotImplementedError() print(waitera_win_test)
### BEGIN TESTS assert waitera_win_test == True ### END TESTS
Looks good, now let's see who won on the first night the new rules were implemented!
Waiter A and B both sold 7 special plates. Waiter A pulled in 120 dollars worth of tips, while waiter B pulled in 125 dollars worth of tips. Store this result as
# YOUR CODE HERE raise NotImplementedError() print(waitera_win_night1)
### BEGIN TESTS assert waitera_win_night1 == False ### END TESTS