Aling Nena sells three types of Banana: banana cue, turon, and maruya. Aling Nena wants a python program that displays the percentage that each of the banana types contributes to the total sales. For example, If Aling Nena sells 50 pcs of banana cue, 25 pcs of turon, and 45 pcs of maruya, the Banana Cue account for approximately 41.7% of the sales. The turon and maruya account for approximately 20.8% and 37.5% respectively, of the Banana sales.
i just can’t answer this problem, helppppppp
>Solution :
Based on the very little information given, here is a rough code that may (?) answer your problem.
#Obtain input numbers
cueCount = int(input("Enter how many Cue sold: "))
turonCount = int(input("Enter how many Turon sold: "))
maruyaCount = int(input("Enter how many Maruya sold: "))
totalCount = cueCount + turonCount + maruyaCount
#Calculate percentages
cueCount = cueCount * 100 / totalCount
turonCount = turonCount * 100 / totalCount
maruyaCount = maruyaCount * 100 / totalCount
#Print results
print(str(cueCount) + "% of sales were Cue Bananas.")
print(str(turonCount) + "% of sales were Turon Bananas.")
print(str(maruyaCount) + "% of sales were Maruya Bananas.")
Please be more detailed with your questions next time.