Subject Computer Science Python Programming

Question

My daughters play volleyball. In volleyball there are 5 matches in a game. At their league they would like a program that will accept the number of points that each team scored in the 5 matches and make a bar graph.
But there is one other important feature. The person that runs the league often gets pulled away. When this happened they will have to exit the program. And when the user brings the program back up it needs to pick up where it left off.
You should not make the user select Save or give a file name and location. It needs to automatically come up where it left off.
Here are some examples of the program running.
Sample 1
This program will graph the scores in a volleyball game.
Enter the score that team 1 got on match 1?
>> 25
Enter the score that team 2 got on match 1?
>> 20
Enter the score that team 1 got on match 2?
>> 25
Enter the score that team 2 got on match 2?
>> 20
Enter the score that team 1 got on match 3?
>> 25
Enter the score that team 2 got on match 3?
>> 20
Enter the score that team 1 got on match 4?
>> 25
Enter the score that team 2 got on match 4?
>> 20
Enter the score that team 1 got on match 5?
>> 25
Enter the score that team 2 got on match 5?
>> 20

Then it draws the graph

Sample 2
This program will graph the scores in a volleyball game.
Enter the score that team 1 got on match 1?
>> 25
Enter the score that team 2 got on match 1?
>> 20
Enter the score that team 1 got on match 2?
>> 25

Terminate the program.
Run the program again.

Enter the score that team 2 got on match 2?
>> 20
Enter the score that team 1 got on match 3?
>> 25
Enter the score that team 2 got on match 3?
>> 20
Enter the score that team 1 got on match 4?
>> 25
Enter the score that team 2 got on match 4?
>> 20
Enter the score that team 1 got on match 5?
>> 25
Enter the score that team 2 got on match 5?
>> 20

Then it draws the graph

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import graphics
from graphics import *

f = open("score.dat", "r")   # a+ : read and append
line = f.read()
if (line):...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Python Programming Problems
Homework Solution
$50.00
Computer Science
Programming
Python
Burrows-Wheeler Transformation
Strings
Sequences
FM-Index
Statements
Variables
Functions
Characters
Symbols
Loops
Guessing Game in Python
Homework Solution
$18.00
Computer Science
Python Programming
Guessing Game
Random Numbers
Average Numbers
Features
Loops
Client/Server Problems Using Sockets
Homework Solution
$50.00
Computer Science
Programming
Algorithms
Clients
Servers
Sockets
Polynomials
Mathematics
Exponents
Port Numbers
Tolerance
Characters
Connection
Functions
Parsing Errors
Strings
Integers
Variables
Data
Exceptions
Python Lab 3, 4, 5
Homework Solution
$50.00
Computer
Science
Python
Programming
Lab
Fibonacci
Merge
Sort
Euclid
Difference
Dictionary
Python Programming Problems
Homework Solution
$50.00
Computer Science
Python
Programming
Algorithms
Page Rank
Numpy
Nodes
Edges
Statements
Variables
Loops
Graph Theory
Random Values
Absolute Values
Neighbors
Indexes
Get help from a qualified tutor
Live Chats