Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

HI! can i have a PYTHON PROGRAM that answers problem like this?

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading