Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

Python banking project

BY: Matt McNally


Introduction
Businesses need to know how much profit or loss they are making. To keep b business
running you need to make a profit. Businesses offer discounts to make people buy their
products so they can earn money.
Coding Python Task 1
• I asked for the product/service’s name
• Then I asked for the cost price and the original selling price
• I then put in the calculations that told the user what the selling price with GST
• I told the user how much profit or loss they were making.
• Next I added a feature that gave the user a option to quit.
• I then added a rounding function to round the decimals to two places
• finally I added a looping function so the user wouldn’t have to rerun the code to preform another
computation.
Coding Python task 2 part 1
• First I asked the user for the original selling price and the price after discount.
• Then put in the calculation that figured out what the percentage discount was.
• Then the program told the user what the percentage discount was.
• I added a feature that asked the user if they wanted to quit.
• I then added a function to round the discount to four decimal points.
• finally I added a feature that looped the code until the user was finished.
Coding python task 2 part 2
• First I asked the user the ticket price and the percentage discount of the item.
• Then I added the calculation that figured out how much money was made or lost.
• after that I added a rounding feature to round how much made or lost to two decimal places.
• Then I added a feature that gave the user the option to quit.
• finally I added a looping feature .
Computational Thinking
Decomposition: The main decomposition that I did was in the calculations that told you your
profit/loss etc.
Algorithms: Every step that I did in this to complete my tasks was ordered, from the profit/loss
calculator to the looping function.
Abstraction: I took out most of the unneeded code, keeping only the ones I used to make the program
as user friendly as I could.
Evaluation : I tried to find how effective my solutions were, tried to see how they could help me in my
other problems and used them any way I could without putting in any unnecessary pieces.
The
challenges I faced were; putting all of the code together, figuring out how to loop code, how to round to
2 decimal points and how to process decimals the user inputs. The way that I did this was searching
online how to loop and round and process decimals in python. I have put the answers on how to loop,
process decimals and round on the next page.
How to Loop and round in python
Rounding: Looping:
a = 189.23457844764975476 a=1
rounda = round(a, 3) while a < 10
print(rounda)
Processing decimals
a = float(input(‘Put in a number with decimal places. The “float” bit at the front allows python to
process decimals. ’))

You might also like