python 3 question
Project Description
Electronic gradebooks are used by instructors to store grades on
individual assignments and to calculate students’ overall grades.
Perhaps your instructor uses gradebook software to keep track of
your grades.
Some instructors like to calculate grades based on what is sometimes called a “total points” system. This is the simplest way to calculate grades. A student’s grade is the sum of the points earned on all assignments divided by the sum of the points available on all assignments. For example, suppose that a computer science class has a set of programming projects, quizzes, and tests, and that the sum of the points of all of these assignments is 485 for a semester. A student earns 412 of those points. Their grade is 412/485, or about 84.95 percent.
In a total points system, instructors have to carefully figure out how many points each assignment should be worth, in order to make sure that certain assignments don’t dominate the students’ grades. Some instructors don’t like to worry about the point value of each assignment, and they prefer what is sometimes called a “weighted category” system.
In a weighted category system, the instructor defines two or
more categories and assigns a percentage weight value to each
category. The sum of the weights adds up to 100. Grades are
calculated by taking the average score of assignments in each
category, multiplying each of those numbers by the weight for its
category, and adding those values together. For example, the
computer science class described above could grade with a weighted
category system by defining three categories: programming projects,
quizzes, and tests. The instructor decides that programming
projects should be worth 45 percent, quizzes 10 percent, and tests
45 percent. A student’s average on programming projects is .95, on
quizzes is .92, and on tests is .85. The student’s grade is:
PROJECTS QUIZZES TESTS GRADE
(.95 × 45) + (.92 × 10) + (.85 × 45) = 90.2
Each value in parentheses is the portion of the total grade for one
category.
In this project, you will complete several classes to create an electronic gradebook that can calculate grades using either the total points system or the weighted category system.
Topics addressed in this project include:
Design Description
Now that you understand the basics of gradebook software, let’s
take a look at the basic classes that will be used in this project.
They have been designed for you, but it’s important that you
understand the design before you attempt to write the code. Here
are the classes used in this project, and the methods defined in
each class:
Implementation Notes: You only need to be concerned with the implementation as described above. For other considerations, like, what happens if the student has an assignment that has a category that is not in the CategoryGradebook? What happens if I don't have category assignments in a CategoryGradebook?? The answer to that is.... you don't care. It is up to the script that is implementing the gradebook to handle situations like that, and you are not required to implement your students, assignments, or gradebooks for this lab. You are simply defining what these objects do, and do not need to worry about how they are used by others.
Test Script: You should run the test script to ensure that your class names and methods are all named correctly. It is up to you to thoroughly test your code, whether this is done through another script, or if you feel comfortable, adding to the test file. You will also need to download the sample files to make sure your output matches what it should.
Hello, here is your code (Text & Screenshot)
Code(TEXT)
#Assignment class class Assignment: #constructor def __init__(self, description:str, score:float, total:float): self.description = description self.score = score self.total = total def getDescription(self)->str: return self.description def getScore(self)->float: return self.score def getTotal(self)->float: return self.total def changeScore(self, newScore:float): self.score = newScore #Category assignment class CategoryAssignment(Assignment): #constructor def __init__(self,description:str, category:str, score:float, total:float): #init the parent class Assignment.__init__(self,description,score,total) self.category = category def getCategory(self)->str: return self.category #student class class Student: #constructor def __init__(self,id:int): self.id = id #assignment list of students self.assignments:list = [] def getId(self)->int: return self.id def getScore(self, assignmentName:str)->float: #iterate through each assignment. for assignment in self.assignments: #check if assigment description matches, #return the score if assignment.description == assignmentName: return assignment.score def getScores(self)->list: return self.assignments def addAssignment(self, score:Assignment): self.assignments.append(score) def changeScore(self, assignmentName:str, score:float): #iterate through assignment list, #if assignment found update the score. for assignment in self.assignments: if assignment.description == assignmentName: assignment.score = score return def removeScore(self, assignmentName:str): for assignment in self.assignments: if assignment.description == assignmentName: self.assignments.remove(assignment) return #Gradebook class class Gradebook: def __init__(self): #creating empty student list. self.students = [] def addStudent(self, student:Student): print("adding student with id: ", student.getId()) self.students.append(student) def dropStudent(self, id: int): for student in self.students: if student.id == id: self.students.remove(student) return def search(self, id:int): for student in self.students: if student.id == id: return student def addAssignment(self,id:int, score: Assignment): #loop through each student in student list and find the student #if student found, loop through each assignment of that student #if assignment found replace it with new one and return from this method. #else append the score to student. for student in self.students: if student.id == id: for i, assignment in enumerate(student.assignments): if score.description == assignment.description: student.assignments[i] = score return student.assignments.append(score) #TotalPointsGradebook class TotalPointsGradebook(Gradebook): def __init__(self): Gradebook.__init__(self) #method writeGradebookRecord def writeGradebookRecord(self, id:int, fileName:str): #open the file with filename f = open(fileName, "w+") #search for student for student in self.students: if student.id == id: #score and total that will calculate total score. score = 0 total = 0 for assignment in student.assignments: f.write("{0}\n".format(assignment.description)) f.write("{0}/{1}\n".format(assignment.score, assignment.total)) score = score + assignment.score total = total + assignment.total f.write("Total: {0}/{1}\n".format(score, total)) f.write("Percentage: {0}".format(score/total*100)) f.close() return f.write("Student Not Found") f.close() def classAverage(self)->float: score = 0 total = 0 for student in self.students: for assignment in student.assignments: score = score + assignment.score total = total + assignment.total return score/total * 100 #For testing a1 = Assignment("Assignment 1",25,40) a2 = Assignment("Assignment 2", 30, 40) s = Student(2) s.addAssignment(a1) s.addAssignment(a2) book = TotalPointsGradebook() book.addStudent(s) print("adding student of id 3") s1 = Student(3) book.addStudent(s1) a3 = Assignment("Assignment 1-3",25,50) book.addAssignment(3,a3) print("Class average: ", book.classAverage()) book.writeGradebookRecord(2,"student1.txt") book.writeGradebookRecord(3,"student2.txt")
Output Sample Text File
student1.txt
Assignment 1 25/40 Assignment 2 30/40 Total: 55/80 Percentage: 68.75
student2.txt
Assignment 1-3 25/50 Total: 25/50 Percentage: 50.0
python 3 question Project Description Electronic gradebooks are used by instructors to store grades on individual assignments and to calculate students’ overall grades. Perhaps your instructor uses gr...
Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might be worth 40% of your final grade. To calculate the grade for the Assignments category, the teacher takes the percentage earned on the assignments and multiplies it by the weight. So if the student earned a 90% total on the Assignments, the teacher would take 90% x 40, which means the student earned a 36 percent on the Assignments section. The teacher then calculates...
please help asap in c++, you dont have to do everything but at least give me a starting idea of how this should look like Write a class Assignment that has private attributes for Name, Possible Points and Earned Points Write a class Student that has private attributes for name and a vector of assignments. The constructor method should require a name. Add a method for get total score that returns the total number of points earned divided by the...
This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp, and Main.cpp 1. The system must be able to manage multiple students (max of 5) and their grades for assignments from three different assignment groups: homework (total of 5), quizzes (total (total of 2) of 4), and exams 2. For each student record, the user should be able to change the grade for any assignment These grades should be accessible to the gradebook for...
PYTHON 3 Object Oriented Programming ***a9q3.py file below*** class GradeItem(object): # A Grade Item is anything a course uses in a grading scheme, # like a test or an assignment. It has a score, which is assessed by # an instructor, and a maximum value, set by the instructor, and a weight, # which defines how much the item counts towards a final grade. def __init__(self, weight, scored=None, out_of=None): """ Purpose: Initialize the GradeItem object. Preconditions: :param weight: the weight...
A csv file called COS-206_gradebook.csv is provided for this project (see Course Documents). This file contains grades data for 17 students on 20 assessments. These assessments include quizzes, homework assignments, term projects, and tests.First you are strongly encouraged to open this file in Excel to gain an overview of the data. Note the second row contains point totals for the assessments. For instance, the point total for hw0 (Homework 0) is 20 while the point total for hw1 (Homework 1)...
Amusement Park Programming Project Project Outcomes Use the Java selection constructs (if and if else). Use the Java iteration constructs (while, do, for). Use Boolean variables and expressions to control iterations. Use arrays or ArrayList for storing objects. Proper design techniques. Project Requirements Your job is to implement a simple amusement park information system that keeps track of admission tickets and merchandise in the gift shop. The information system consists of three classes including a class to model tickets, a...
Your assignment is to write a grade book for a teacher. The teacher has a text file, which includes student's names, and students test grades. There are four test scores for each student. Here is an example of such a file: Count: 5 Sally 78.0 84.0 79.0 86.0 Rachel 68.0 76.0 87.0 76.0 Melba 87.0 78.0 98.0 88.0 Grace 76.0 67.0 89.0 0.0 Lisa 68.0 76.0 65.0 87.0 The first line of the file will indicate the number of students...
AA. Final Project - Improved JavaFX GUI Personal Lending Library Description: In this project we will improve our personal lending library tool by (1) adding the ability to delete items from the library, (2) creating a graphical user interface that shows the contents of the library and allows the user to add, delete, check out, or check in an item. (3) using a file to store the library contents so that they persist between program executions, and (4) removing the...
COSC 1437 C++2 Project Assignment 3 Description: Computer Science Department is evaluating its professors to see which professor has the highest rating according to student input. You will create a ProfessorRating class consisting of professor Name and three ratings. The three ratings are used to evaluate easiness, helpfulness, and clarity. The value for each rating is in the range of 1 to 5, with 1 being the lowest and 5 being the highest. Your program should contain the following functionalities:...
Need code written for a java eclipse program that will follow the skeleton code. Exams and assignments are weighted You will design a Java grade calculator for this assignment. A user should be able to calculate her/his letter grade in COMS/MIS 207 by inputting their scores obtained on worksheets, assignments and exams into the program. A skeleton code named GradeCompute.java containing the main method and stubs for a few other methods, is provided to you. You must not modify/make changes...