0

Ticket Office ( Revenue Growth Analysis) I think the question is little confusing.Can anyone explain, pls?

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% So, for the input 14, your program should output 20. The output should be an integer (use int() to convert the result).

23rd Aug 2021, 5:20 AM
Gokul Ananth
Gokul Ananth - avatar
9 Antworten
+ 2
These two values are example only for understand the final process calculation .... You have to extract either values from dataset keeping that a single ticket for adult (age >= input) cost $20 and ticket discountend (age < input) cost $5
23rd Aug 2021, 6:02 AM
KrOW
KrOW - avatar
+ 1
No, I didn't get the error like that what you are telling. I have just asked the doubt what I have. Will you know the answer??
23rd Aug 2021, 5:30 AM
Gokul Ananth
Gokul Ananth - avatar
+ 1
Im having issues with test case 2. I pass test case 1 and then some how I am off by one on test case 2. I get 32 not 31. Can someone look at my code and see what is wrong? test case 1 is 16 and I get 5 which is correct test case 2 is 10 and i get 32 data = { "100-90": 25, "42-01": 48, "55-09": 12, "128-64": 71, "002-22": 18, "321-54": 19, "097-32": 33, "065-135": 64, "99-043": 80, "111-99": 11, "123-019": 5, "109-890": 72, "132-123": 27, "32-908": 27, "008-09": 25, "055-967": 35, "897-99": 44, "890-98": 56, "344-32": 65, "43-955": 59, "001-233": 9, "089-111": 15, "090-090": 17, "56-777": 23, "44-909": 27, "13-111": 21, "87-432": 15, "87-433": 14, "87-434": 23, "87-435": 11, "87-436": 12, "87-437": 16, "94-121": 15, "94-122": 35, "80-089": 10, "87-456": 8, "87-430": 40 } age = int(input()) #your code goes here l = data.values() org = 0 profit = 0 for i in l: if i > age: profit += 20 else: profit += 5 for i in l: if i > 18: org += 20 else: org += 5 print(int(((profit-org)/org)*100))
5th Sep 2021, 8:43 PM
Ashton Wilson
Ashton Wilson - avatar
0
What you dont understand?
23rd Aug 2021, 5:46 AM
KrOW
KrOW - avatar
0
What is that $15000 and $18000? How did those came? This is my doubt...KrOW
23rd Aug 2021, 5:56 AM
Gokul Ananth
Gokul Ananth - avatar
0
Oh, fine. Thank you, if I have any doubt I will ask. Thank you very much.KrOW
23rd Aug 2021, 6:10 AM
Gokul Ananth
Gokul Ananth - avatar
0
👍🏻
23rd Aug 2021, 6:16 AM
KrOW
KrOW - avatar
0
Have you solved it ?
25th Aug 2021, 2:47 AM
Sacar
Sacar - avatar