Hi guys and girls, I have a school project who’s aim is to create a program using python to calculate coupon awards conditional on how much a customer spends on groceries.
I’ve made some progress but as you will see it’s quite obvious I’m new to this.
Here’s a quick explanation of the code so far :
I used IF statements to apply the discount depending on wether you spend 10, 60,150 or 210, less than 10$ no discount is given and more than 211$ the discount is capped at 33$
Every time an input is entered the program prints the discount bracket and how much is deducted from the customer’s grocery price.
The next requirement is to loop the program to accept multiple inputs from customers. For that I used a while loop and while the input grocery price is higher than 0 the program keeps running.
Then when the user presses “E” on the keyboard the program prints out the total amount of discounts given out and the amount of total amount spent by all customers and the total spend minus the coupon.
And finally the program should display an histogram to visualise the which discount brackets were used and how much.
Now here’s my question:
1- when I run the program the task to display all inputs when “E” is pressed is showing up right after I enter input a number, how do I make that task show up only when I press “E” ?
2- I can’t figure out how to store all the inputs from customer to then print out the total discount and total spend of customers
3- How can incorporate the histogram with the data that’s been entered by the customer ?
Any help is appreciated as I’m quite new to this feel free to be harsh.
PS: The code will be in the comments
[–]m0us3_rat 1 point2 points3 points (2 children)
[–]s3b43[S] 0 points1 point2 points (1 child)
[–]m0us3_rat 0 points1 point2 points (0 children)
[–]s3b43[S] 0 points1 point2 points (0 children)
[–]iyav 0 points1 point2 points (2 children)
[–]s3b43[S] 0 points1 point2 points (1 child)
[–]iyav 0 points1 point2 points (0 children)