Tags: %TAGME{ tpaction="" web="SCMP118" tag="" }% view all tags

Student Class

Hands on Activity

Lucern Vasquez is trying to keep track of her students grades, and you have volunteered to help. She wants to keep a list of students, and record and compute their grades.

She wants to keep track of the students name, their level (First year, etc), their email address, and pronouns. She also wants to be able to enter grades for the students. She wants to add assignments with grades any time, and each grade will include a assignment name, a grade (from 0 to 100), and a weight. The weight is a number from 1 to 10, indicating it's contribution to the final grade. We can then compute the total grade for each student by adding the weights of all the grades to get weightSum. Then overall grade is computed as the

(sum of the products of the grade x weight) / (sum of the weights)


Assignment Weight Product
67 1 67
92 2 184
87 10 870
78 2 156
95 10 950
Sum 25 2227
Grade: 89.08

Step 1:

Create a representation fort the strudent and for each grade as a class. The student should include an array of grades.

COnsider what the variables are in the class, and what the methods are.

Step 2:

Write the grade class, and create a test program to test it.

Step 3:

Write the students class, and create a test program to test it.

Step 4:

Write the program thatr uses the classes. The program starts with aen empty list of students. It then allows user to enter student information and a set of grades for a student, as many times as the user wants. it then prints out a list of the students and their grades, and their total grade.

Step 5:

Allow the user to enter more students, or to select an existing student, and add assignements and scores to their objectrs.

Solution: https://repl.it/@JimSkon/StudentGradesClass

-- Jim Skon - 2019-10-23


Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2019-10-29 - JimSkon
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback