Skip to content

Statement, Expression, Hoisting, Objects, and Arrays #2

@HikmatullahEhsan

Description

@HikmatullahEhsan

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

Metadata

Metadata

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions