If-Else Statements
4 / 4
Other Boolean operations
You are developing a finance app to help users decide whether or not to purchase an item.
Take the following Boolean inputs:
emptySavings
: the user's savings account is almost empty.essential
: the purchase is essential (e.g., groceries, rent).onSale
: the item is available on a discounted price. A purchase should be approved if the item is essential, or if the user has some savings left and the item is on sale.
Print approved
or denied
based on whether a purchase is approved.