Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
HikmatullahEhsan opened this issue Sep 8, 2021 · 0 comments
Open

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

HikmatullahEhsan opened this issue Sep 8, 2021 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@HikmatullahEhsan
Copy link
Owner

HikmatullahEhsan commented Sep 8, 2021

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

@HikmatullahEhsan HikmatullahEhsan added the question Further information is requested label Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants