Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For python 3.4 So far I have from graphics import * def main(): inFile = open(numbers.txt,'r') for i in range(5): data = inFile.readline() # draw

For python 3.4

image text in transcribed

So far I have

image text in transcribed

from graphics import *

def main(): inFile = open("numbers.txt",'r')

for i in range(5): data = inFile.readline() # draw bar for this value bar = Rectangle(Point(data, 230), Point(data, 230)) bar.setFill('green') bar.setWidth(2) bar.draw(win)

# Create a graphics window with x axis win = GraphWin("5 Test Scores", 380, 340) win.setBackground('orange') title = Text(Point(200,25), '5 Test Scores') title.setSize(20) title.draw(win) intXAxes = 0 int10 = 0 for i in range (0,10): intXAxes+=35 int10+=10 Text(Point(intXAxes,325), str(int10)).draw(win)

# It is good programming practice to close your files/objects. inFile.close()

win.getMouse() win.close()

main()

Create a graphics window program that shows off a student's scores. Import the 5 scores from a file. The file will have exactly 5 test scores (from 0-100). Those scores will appear in a window as a series of bars. You will call a function to draw the bars in the window Each bar will be a different color, the score will appear inside at the end of the bar. There will a scale at the bottom of 0-100

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_2

Step: 3

blur-text-image_3

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

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago

Question

Explain the process of Human Resource Planning.

Answered: 1 week ago