Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Assignment 1 Score Collection The goal is to write some software that would assist in the collation of scores in a competition where individuals are timed performing different tasks. The scores will...

1 answer below »
Assignment 1
Score Collection
The goal is to write some software that would assist in the collation of scores in a competition where individuals are timed performing different tasks. The scores will be entered, processed, and then ultimately analysed.
The assignment will get progressively more complex as it proceeds - the early stages will be reasonable straight forward and will be sufficient for a passing grade, and the more advanced stages are for those who wish to go further and target a higher overall result. As a general rule, to pass you will need to complete Stage 1 with commenting, and a P1 requires stage 2. Stage 3 will determine grades between credit and distinction, and completing stage 4 should gain a high distinction, noting that we will be considering commenting and how well it meets the specifications in determining the grade.
General Requirements
All assignments should be written in Python 3 and should run in IDLE. They can be written on any type of computer, but they should be able to be executed in the computer pool.
The highest marks will be for working code. However, in cases where there are problems, you will be assigned marks for how you approached the task. It is also expected that you will provide comments in the programs to explain how it works, and these comments will account for up to 10% of the overall grade.
In each case example output is given. You should try and make your output and process match the example as closely as possible.
Stage 1: Data Entry
Write a program which requests that requests a name and score, with teh score in a range of 0 to a maximum of 56. Store that data in a List. After the user has entered data, request that the user enters 'y' or 'n' to continue. If they enter 'n', print the list of names and sales figures to the screen. If they enter 'y', repeat the first step.
Your program should produce the following result:
Competition Results
Name: Gaye Deegan
Score: 52
Continue? [y/n] y
Name: Ben Martini
Score: 34
Continue? [y/n] n
----------------------------
Gaye Deegan XXXXXXXXXX
Ben Martini XXXXXXXXXX
----------------------------
Stage 2: Validation and Summary
Building on stage 1, you now need to ensure that the program checks for valid entries in each case, and converts the text to the appropriate format.
You need to:
· Ensure that a name and score were entered. If any of these were not entered, do not record that entry and go straight to asking if they wish to continue.
· Ensure the score is between 0 and 56. If it is not in that range, do not record that entry and go straight to asking if they wish to continue.
· Ensure that the user enters either "Y", "y", "N" or "n" when asked if they wish to continue. Continue to ask until they enter a valid result.
In addition, you now need to provide a
ief summary by adding up the score that are entered and providing a "average score" figure, as per the output below.
Sample output:
Competition Results
Name: Gaye Deegan
Score: 52
Continue? [y/n]
Continue? [y/n] Y
Name:
Name: Ben Martini
Score: 80
Name: Ben Martini
Score: 32
Continue? [y/n] n
-----------------------------
Gaye Deegan XXXXXXXXXX
Ben Martini XXXXXXXXXX
-----------------------------
Average score XXXXXXXXXX
Stage 3: Multiple Scores
This involves five separate jobs. Note that these may prove difficult - for full marks you will need to complete all of these tasks, but you will still get marks for only completing some.
· Create a menu to select whether to change/enter the team, add sscores, generate a report, export the data to CSV files, or quit.
· Allow the user to set a team name.
· When the user enters the score (a name plus a score, as per Stages 1 and 2) also record what team the score was for.
· When generating a report (as per Stages 1 and 2), include a list of teams and the average score per team.
· If the user selects export, output the two sets of data (teams and average score per team; competitors and their scores) as two CSV files.
Sample Output
--------------------------------
Competition Results
--------------------------------
Cu
ent Store:
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 1
--------------------------------
Team: UniSA
--------------------------------
Cu
ent team: UniSA
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 2
--------------------------------
Name: Gaye Deegan
Score: 46
--------------------------------
Cu
ent Store: UniSA
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]:
--------------------------------
Cu
ent team: UniSA
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 2
--------------------------------
Name: Ben Martini
Score: 36
--------------------------------
Cu
ent team: UniSA
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 1
--------------------------------
Team: STEM
--------------------------------
Cu
ent team: STEM
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 2
--------------------------------
Name: Scott Stevens
score: 55
--------------------------------
Cu
ent team: STEM
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 3
--------------------------------
UniSA          41
STEM          55
--------------------------------
Gaye Deegan     UniSA     46
Ben Martini     UniSA     36
Scott Stevens     STEM     55
--------------------------------
Winner     XXXXXXXXXXSTEM
--------------------------------
Cu
ent Store: STEM
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 4
--------------------------------
Data exported
--------------------------------
Cu
ent Store: STEM
1: Enter team
2: Enter score
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: q
Sample output files (the two CSV files) will be included on the course website.
Stage 4: Importing Data
For the last stage we will tie this work into something that we might use in the real world - collating data. Each team will generate a report listing all scores by their team members. You will need to import the data, collate it, and produce the report and CSV files as per stage 4.
The files will contain records where each row has two pieces of data - the name of the competitor and their score.
Gaye Deegan; 52
Each file will represent one team as specified by the file name. There will be a random number of records, and a random number of competitors. As you load each file you will need to check to make sure that each entry meets two requirements:
· The name has not already been entered elsewhere
· The score is between 0 and 56.
If a row fails verification, you ignore the row, provide an e
or message stating the row number in which the e
or occured, and move on.
When the records are loaded, you need to find the top five scores, combine them, and produce an average. That is the team score. If there are less than five scores provided, you need to enter "0" for the missing scores. For example, if there are only two competitors for a team, and their scores are 50 and 30, their overall score is "80" XXXXXXXXXX0) and their final team score is 16 (80 / 5).
A report at the end should:
· List the teams and their team scores
· List the top 5 competitors and their individual scores
Ideally, this will be in the order for first to last.
Finally, you should be able to export this report as two CSV files.
Data files will be provided.
Sample Output
--------------------------------
Competition Results
--------------------------------
Cu
ent team:
1: Enter team
2: Import scores
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 1
--------------------------------
Team: Mawson Lakes
--------------------------------
Cu
ent team: Mawson Lakes
1: Enter team
2: Import scores
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 2
--------------------------------
File name: mawsonlakes.txt
6 scores loaded.
--------------------------------
Cu
ent team: Mawson Lakes
1: Enter team
2: Import scores
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 1
--------------------------------
Team: Magil
--------------------------------
Cu
ent team: Magil
1: Enter team
2: Import scores
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 2
--------------------------------
File name: magill.txt
Row 3 has an e
or. It has not been included.
4 scores loaded.
--------------------------------
Cu
ent team: Magil
1: Enter team
2: Import scores
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: 3
--------------------------------
Mawson Lakes          43.2
Magil          XXXXXXXXXX
--------------------------------
Scott Stevens XXXXXXXXXX
Sato Aiko XXXXXXXXXX
Gaye Deegan          45
Zhang Zhen          44
Ramesh Kumar     XXXXXXXXXX
--------------------------------
Cu
ent team: Magil
1: Enter team
2: Import scores
3: Generate report
4: Export CSV
Q: Quit
--------------------------------
Enter your choice [1/2/3/4/Q]: q

Gaye Deegan;45
Ben Martini;36
Scott Stevens;52
Woodie Flowers;28
Zhang Zhen;44
Ramesh Kumar;38
Answered 3 days After Apr 16, 2021

Solution

Vaishnavi R answered on Apr 19 2021
147 Votes
New folder (2)/output1.csv
New folder (2)/output2.csv
New folder (2)/sample-file-task-3-competitoroutput-3s4gcm3j.csv
'Gaye Deegan','UniSA',46
'Ben Martini','UniSA',36
'Scott Stevens','STEM',55
New folder (2)/sample-file-task-3-teamsoutput-rdmxgszt - Copy.csv
'UniSA',41
'STEM',55
New folder (2)/stage2.py
# -*- coding: utf-8 -*-
"""stage2.ipyn
Automatically generated by Colaboratory.
Original file is located at
https:
colab.research.google.com/drive/1zjBbceqPRcvDSiSKbD6hVLxzft_bjFLL
"""
keepAsking = True
a = []
avg = 0
count=0
print("Competition Results", "\n")
while (keepAsking == True):
name = input("Name of Student: ")
score = input("Score obtained by Student: ")
if(int(score)>0 and int(score)<56):
print(name, "(", score, ")", "has been added to the list.")
ent = name + " - " " (" + score + ")"
a.append(ent)
avg +=int(score)
count+=1
c = input("Continue? [y/n]")
if c == "n":
keepAsking = False
avg = avg/count
for i in range(len(a)):
n= i + 1
print (str(n)+". "+a[i])
n = n + 1
print("Average score "+ str(avg));
print("Thank you")
keepAsking = True
a = []
avg = 0
count=0
print("Competition Results", "\n")
while (keepAsking == True):
name = input("Name of Student: ")
score = input("Score obtained by Student: ")
if(int(score)>0 and int(score)<56):
print(name, "(", score, ")", "has been added to the list.")
ent = name + " - " " (" + score + ")"
a.append(ent)
avg +=int(score)
count+=1
c = input("Continue? [y/n]")
if c == "n":
keepAsking = False
avg = avg/count
for i in range(len(a)):
n= i + 1
print (str(n)+". "+a[i])
n = n + 1
print("Average score "+ str(avg));
print("Thank you")
New folder (2)/stage3.py
# -*- coding: utf-8 -*-
"""stage3.ipyn
Automatically generated by Colaboratory.
Original file is located at
https:
colab.research.google.com/drive/1zjBbceqPRcvDSiSKbD6hVLxzft_bjFLL
"""
import csv
team = False
q = False
teamnames = []
storage ={}
averages =[]
while q == False:
if team==False :
print("Cu
ent store: \n")
else:
print("Cu
ent store: "+ cu
team)
print("1: Enter team \n")
print("2: Enter...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here