You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a program to calculate the total price of your phone purchase. You will keep purchasing phones (hint: loop!) until you
run out of money in your bank account. You’ll also buy accessories for each phone as long as your purchase amount is below
your mental spending threshold.
• After you’ve calculated your purchase amount, add in the tax, then print out the calculated purchase amount, properly for‐
matted.
• Finally, check the amount against your bank account balance to see if you can afford it or not.
• You should set up some constants for the “tax rate,” “phone price,” “accessory price,” and “spending threshold,” as well as a
variable for your “bank account balance.”
• You should define functions for calculating the tax and for formatting the price with a “$” and rounding to two decimal
places
The text was updated successfully, but these errors were encountered:
Write a program to calculate the total price of your phone purchase. You will keep purchasing phones (hint: loop!) until you
run out of money in your bank account. You’ll also buy accessories for each phone as long as your purchase amount is below
your mental spending threshold.
• After you’ve calculated your purchase amount, add in the tax, then print out the calculated purchase amount, properly for‐
matted.
• Finally, check the amount against your bank account balance to see if you can afford it or not.
• You should set up some constants for the “tax rate,” “phone price,” “accessory price,” and “spending threshold,” as well as a
variable for your “bank account balance.”
• You should define functions for calculating the tax and for formatting the price with a “$” and rounding to two decimal
places
The text was updated successfully, but these errors were encountered: