Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use python. # IDLE. please I also want to also show me the text editor document you used... for the second picture i tried

please use python. # IDLE. please I also want to also show me the text editor document you used... image text in transcribed
image text in transcribedfor the second picture i tried doing it but couldnot finish if you can assist me here please
16. Write a program to draw a quiz score histogram. Your program should read data from a file. Each line of the file contains a number in the range 0-10. Hour program must count the number of occurrences of each score and then draw a vertical bar chart with a bar for each possible score (0- 10) with a height corresponding to the count of that score. For example, if 15 students got an 8, then the height of the bar for 8 should be 15. Hint: Use a list that stores the count for each possible score. An example histogram is shown below: 8P], opo 9 10 7 8 3 4 5 6 Python File Edit Window Help from graphics import* Histogram.py - /Users/kobby Des def main(): infile = open('histogram.txt', 'r') score = (1,3,0,0,6,6,7,9,6,7,0) student = 0 for i in infile: score[int(i)] = score[int(i))+1 student = student+1 win - Graphwin'Quiz score Histogram., 35,270) win.setCoords(0,0,35, 27) bottomBG - Rectangle(Point(e,e), Point(35,4)) bottomBG.setFill('cyan) bottomBG.draw(win) buttonShadow - Rectangle(Point(27.5, 0.5), Point(34.5,3)) buttonShadow. setFill(color_rgb(64,64,64)) buttonShadow.draw(win) buttonBox - Rectangle(Point(27.25, 0.75), Point(34.25, 3.25) buttonBox. setFill(color_rgb(154, 154, 154)) buttonBox.draw(win) buttonText = Text(Point(30.75,2), 'close) buttonText. setFill(white) buttonText.draw(win) student = Total number of students: str(student) print(studeno) totalStudent = Text (Point (10,2), student) totalStudent.setFill(Black) totalStudent.draw(win) Line(Point(1,5), Point(34.5,5).draw(win)) Line(Point(1,5), Point(1,26)).draw(win) for i in range(6,26)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions