- 3

revenue growth analysis

You are analyzing sales data from a ticket office. The ticket for an adult is $20, while the ticket for a child under 18 is $5. The data you are given is in a dictionary format, where the keys are the sold ticket numbers, and the values are the customer ages. For example, "123-08": 24 means that the ticket was bought a 24 year old. Your goal is to calculate how much more money the office would make if it would change the ticket discount age to the given input. So, your program needs to take an integer as input and output the percentage of revenue growth, if the discount was given to people under that age. For example, if the office made $15000 with the original discount age, and would make $18000 with 14 as the discount age, then the growth would be ((18000-15000)/15000)*100 = 20%

15th Oct 2021, 7:52 PM
veena
veena - avatar
6 Réponses
+ 5
veena You will need to create two values for your final comparison. First value =0 Iterate through your dictionary comparing the age values. if the age is >= 18 add 20 to first value else add 5 to first value First value will now tell you how much they make normally. second value =0 do the same as above except compare age to the integer input. second value will now have a different amount of money (younger age -> more money) Then follow the given equation to get your percentage return
15th Oct 2021, 8:39 PM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
simon sauter i did not ask to help in writing code .i just asked that to help in understanding question. i am just learning now how to build difficult codes. anyway thank you for your references
21st Oct 2021, 10:54 PM
veena
veena - avatar
+ 1
rik thank you so much for your help
21st Oct 2021, 10:54 PM
veena
veena - avatar
+ 1
David McCarthy 14 was used in the example so you can understand the effect of the second input upon the profit margin. The second input is a user input, which can be adjusted / varied.
3rd Jul 2023, 8:55 PM
Rik Wittkopp
Rik Wittkopp - avatar
0
Hey guys, For this project it took me forever because I had one thing wrong (found help on these forums): For the second iteration, instead of i >= age, I used i >= 14 because it asked to change the discount age to 14 for the potential revenue. I don't understand why i >= age works when in the first iteration it's i >= 18. Could someone explain this? If that didn't make sense I'll follow up
3rd Jul 2023, 2:35 PM
David McCarthy
David McCarthy - avatar