You are organising a cake sale and want to predict how much money you will raise.
During this cake sale you will be selling the following three types of cakes:
You decide to write a python script that asks the user three questions:
- How many cupcakes do you plan to sell?
- How many macarons do you plan to sell?
- How many cheesecake do you plan to sell?
The python script will then calculate the total money raised using the three user inputs and the prices as follows:
- Cupcakes: 40p per cupcake,
- macarons: 50p per macaron,
- cheesecake: 70p per slice.
The script will finally display this information (total money raised) to the end-user.
Complete the code
Complete your code in the trinket below.
Once your code is done, complete the following tests to check that your code is working as it should:
|Test #||Input Values||Expected Output||Actual Output|
It did cost £12 pounds to buy all the ingredients to bake all the cakes.
Adapt your program to calculate and display the profit knowing that:
profit = money raised – expenses
Then use an If statement to check whether you have made a profit (profit > 0) or a loss (profit < 0) or whether you did break even (profit == 0).
Solution...The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area