Help me to solve REVENUE GROWTH ANALYSIS | Sololearn: Learn to code for FREE!

-4

Help me to solve REVENUE GROWTH ANALYSIS

2/5/2021 12:17:37 PM

Nafis Sadiq Bhuyan

16 Answers

New Answer

+5

This is my code: age = int(input()) teen = 0 lista = 0 for value in data.values(): if value < 18: teen += 1 for value in data.values(): if value < age: lista += 1 total_tickets = len(data) menores_edad = teen mayores_edad = total_tickets - teen original_price = 20 * mayores_edad + 5 * menores_edad menores_lista = lista mayores_lista = total_tickets - menores_lista total_price_discount = 5 * menores_lista + 20 * mayores_lista print(int((( total_price_discount - original_price) / original_price ) * 100))

+4

Please show us your attempt so far.

+4

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()) list=list(data.values()) def rev(a): sal=0 for i in list: if i<a: sal = sal+5 else: sal = sal+20 return sal curr_rev=rev(18) pred_rev=rev(age) growth=int((pred_rev - curr_rev )*100/ curr_rev ) print(growth)

+4

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 adult_ticket = 20 child_ticket = 5 def revenue(x): income = 0 for value in data.values(): if value < x: income += child_ticket else: income += adult_ticket return income original_discount_age = revenue(18) new_discount_age = revenue(age) revenue_growth = int(((new_discount_age - original_discount_age) / original_discount_age *100)) print(revenue_growth)

+1

https://www.sololearn.com/Discuss/2682312/?ref=app

0

Abhay this is in python data structure course End of module project

0

Nafis Sadiq Bhuyan i still don't know where to search for it , probably copy paste the question with your code attempt so people can actually help you.

0

my attempt so far. 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-19":5, "109-890":72, "132-123":27, "32-908":27, "008-09":25, "095-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("enter your age here:")) x = int(input("enter profit for original discount age:")) y = int(input("enter profit for age:")) i =x for value in data.values(): growth = ((y-x)/x)*100 print(int(growth)) please someone should guide me. i dont know how they expect me to know the money that will be made for the original discount age and what will be made for the current discount age

0

Thanks so much

0

Your welcome

0

This is my attempt so far , i don't know why it is considered wrong ? total = 0 data = data.values() for age in data: if age < 18: total += 5 else: total += 20 print (total) user_age = int(input()) new_total = total for age in data: if age < user_age: new_total += 5 else: new_total += 20 print (new_total) revenue_growth = (new_total / total )*100 print (revenue_growth)

0

This is my version in functional programming paradigm.... https://code.sololearn.com/c2xTaB112w37/?ref=app

0

Question: Revenue Growth Analysis Ticket Office 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).

0

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()) #creat a function to find the revenue def revenue(age2): adult = 0 kid = 0 for value in data.values(): if value < age2: kid += 1 else: adult += 1 return ((adult * 20) + (kid * 5)) # Calculate percentage revenue growth old_growth = revenue(18) growth_perc = ((revenue(age)-old_growth)/old_growth) print(int(growth_perc *100))

0

#here is what i did 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 sum=0 original=0 for value in data.values(): if value<age: sum+=5 else: sum+=20 for value in data.values(): if value<18: original+=5 else: original+=20 growth=((sum-original)/original)*100 print(int(growth))

-4

I can't find this code coach