- 15th Jul 2024
- 17:54 pm
In this assignment our experts can assist by developing a robust Python program tailored to process and analyze the student_data.csv from SYST/CYSE-130. They ensure accurate calculation of total scores and final grades, generating cyse130_all.csv and cyse130_top5.csv with clear, organized data. This approach helps in efficiently managing and presenting academic performance insights crucial for educational evaluation and decision-making.
- The new files shall have 2 additional columns containing each student’s total score and final grade. Use "total" and "grade" as headers for the new columns. Additionally, the file cyse130_top5.csv shall contain exactly 5 students with the highest total scores in the course.
- To calculate a student’s total score; Calculate the sum of the best 5 quiz scores (i.e., drop the 2 least scores on the quizzes), plus the sum of all zyBooks, problem sets and exam scores.
Analyze and Generate Grade Reports for SYST/CYSE - Get Assignment Solution
Please note that this is a sample assignment solved by our Python Programmers. These solutions are intended to be used for research and reference purposes only. If you can learn any concepts by going through the reports and code, then our Python Tutors would be very happy.
- Option 1 - To download the complete solution along with Code, Report and screenshots - Please visit our Python Assignment Sample Solution page
- Option 2 - Reach out to our Python Tutors to get online tutoring related to this assignment and get your doubts cleared
- Option 3 - You can check the partial solution for this assignment in this blog below
Free Assignment Solution - Analyze and Generate Grade Reports for SYST/CYSE
def calculate_grade(totalScore):
if(totalScore >= 97):
return 'A+'
elif(totalScore >= 94):
return 'A'
elif(totalScore >= 90):
return 'A-'
elif(totalScore >= 86):
return 'B+'
elif(totalScore >= 83):
return 'B'
elif(totalScore >= 80):
return 'B-'
elif(totalScore >= 76):
return 'C+'
elif(totalScore >= 73):
return 'C'
elif(totalScore >= 70):
return 'C-'
elif(totalScore >= 60):
return 'D'
return 'F'
def sumOfBestFive(lst):
lst.sort()
totalScore = 0
for i in range(2,7):
totalScore += lst[i]
return totalScore
def writeToFile(line):
f = open("cyse130_all.csv", "a")
f.write(line)
f.close()
def writeToFile2(line):
f = open("cyse130_top5.csv", "a")
f.write(line)
f.close()
def main():
dct = {}
file1 = open('student_data.csv', 'r')
lineCount = 0
for line in file1:
# print(line)
# Skip the very first line
if(lineCount != 0):
# Fetch the line from the file
tokens = line.split(",")
zyBooksScore = 0
quizScore = 0
examScore = 0
problemSetScore = 0
quizScoreList = list()
for i in range(3, 13):
zyBooksScore += float(tokens[i])
for i in range(13, 18):
problemSetScore += float(tokens[i])
for i in range(18, 25):
quizScoreList.append(float(tokens[i]))
quizScore = sumOfBestFive(quizScoreList)
examScore += float(tokens[25]) + float(tokens[26])
#print(str(zyBooksScore))
#print(str(problemSetScore))
##print(str(quizScore))
#print(str(examScore))
totalScore = round(zyBooksScore + problemSetScore + quizScore + examScore)
grade = calculate_grade(totalScore)
# print(str(totalScore) + str(grade))
dct[lineCount] = totalScore
line = line.strip() + "," + str(totalScore) + "," + str(grade) + "\n"
else:
line = line.strip() + ",totalScore,grade\n"
writeToFile2(line)
writeToFile(line)
lineCount += 1
# Sort the dictionary
counter = 0
lineNumbers = []
for k in sorted(dct, key = dct.get, reverse = True):
counter += 1
lineNumbers.append(k)
if(counter == 5):
break
# Closing file
file1.close()
#print(str(lineNumbers))
file1 = open('student_data.csv', 'r')
lineCount = 0
for line in file1:
#print(str(lineCount))
if lineCount in lineNumbers:
writeToFile2(line.strip() + "," + str(dct[lineCount]) + "," + str(calculate_grade(dct[lineCount])) + "\n")
lineCount += 1
file1.close()
main()
Get the best python assignment help and tutoring services from our experts now!
About The Author - Dr. James Harris
Dr. James Harris is an esteemed professor of Computer Science specializing in data analysis and educational technology. With a focus on developing efficient algorithms and teaching programming skills, Dr. Harris integrates practical assignments that challenge students to apply their knowledge in real-world scenarios. His expertise in Python programming and data manipulation equips learners with the tools they need to excel in courses like SYST/CYSE-130, ensuring they can handle complex data sets and generate insightful analyses.