Write the solution in python Create a class for a Test. Tests are used for grading purposes and will need to keep track

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Write the solution in python Create a class for a Test. Tests are used for grading purposes and will need to keep track

Post by answerhappygod »

Write the solution in python
Create a class for a Test. Tests are used for grading purposes
and will need to keep track of the student that took the test, the
total possible points, and the points earned on the test. test
points are not required to total 100.
a. Make sure to follow best practices when encapsulating the
test information.
b. An test is created with the name of the student taking the
test and the total possible points. The other fields should be set
to default values.
c. Write accessors for the student's name, total points, and
earned points.
d. Write mutators for the earned points.
e. Write a method that computes and returns the student's grade
as a ratio of earned points to total points. The value returned
should be out of 100, e.g. 57.6 rather than 0.576.
To make using the Test class easier to use, add methods to
support the following built-in features:
a. Printing a string representation of the test includes the
student's name and grade received.
b. Two tests are considered equivalent to each other if they
were taken by the same student.
c. Enable an instance of the class to be used as the key in a
dictionary or item in a set. (You must write an explicit built-in
method to handle this case.)
d. Support the ability to order tests by grade and, if two
students received the same grade, by student name.
The test management process follows these steps:
a. Each student returns the completed test to the instructor who
places them one on top of the other forming a large pile of tests
with the first test on the bottom and the last test on the top.
b. After the test, the instructor carries the pile of tests back
to their office for grading. They remove each test from the pile
one at a time starting with the test at the top and working their
way down.
c. After all of the tests have been graded, the grades are
entered into the grade database in the same order that the tests
were graded - that is to say that the first test that was graded
will be the first entered into the grading system.
d. To see how students are doing, the instructor sorts the grade
database by grade then student name, and prints the database.
Write a function that uses the appropriate data structures to
simulate the steps of giving the test, grading the test, entering
the grades into a database, and printing the sorted database.
Requirements/Suggestions:
a. It is strongly recommended you write a helper function for
each step.
b. Simulate 30 students taking a test. The number of points that
the test is worth is up to you.
c. test grades should be randomly assigned - you may choose how
to do this.
d. test scores are capped at 100% Example output for 10 students
taking a test worth 50 points. You do not have to match this output
exactly! But make not of the relative order of the output at each
step!
Administering tests:
Completed: Joseph Spiner (0.00)
Completed: Goatbert Q. Stewart (0.00)
Completed: Goatbert McDrumpf (0.00)
Completed: Goat Winthorpe (0.00)
Completed: Brynn N. Wilson (0.00)
Grading tests:
Graded: Brynn N. Wilson (80.00)
Graded: Goat Winthorpe (84.00)
Graded: Goatbert McDrumpf (78.00)
Graded: Goatbert Q. Stewart (48.00)
Graded: Joseph Spiner (60.00)
Entering grades into the grade database:
Entered: Brynn N. Wilson (80.00)
Entered: Goat Winthorpe (84.00)
Entered: Goatbert McDrumpf (78.00)
Entered: Goatbert Q. Stewart (48.00)
Entered: Joseph Spiner (60.00)
Displaying sorted grades:
Goat Winthorpe (84.00)
Brynn N. Wilson (80.00)
Goatbert McDrumpf (78.00)
Joseph Spiner (60.00)
Goatbert Q. Stewart (48.00)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply