Carter's
Carter's
ASSESSMENT
ON
COMPUTER PROGRAMMING II
WITTEN BY:
ETA KELVIN-CARTER EFOLI
MATRIC NUMBER: 20/097344053
October, 2023
ALGORITHM
STEP 1: START
STEP 2: SET K= 1
START
K 1
OBTAINED SCORE POINT SUM OF (MATH 101, CHM 101, PHY101, GSS101, CSC
101 CREDIT UNIT) * (OBTAINED CREDIT POINT)
K K+1
K ≤ 20
END
Num_students = 20
Num_courses = 5
Students = []
Class student:
self.name = name
self.matric_number = matric_number
self.courses = []
def calculate_gpa(self):
total_credit_points = 0
total_credit_units = 0
total_credit_points += course[‘credit_points’]
total_credit_units += course[‘credit_unit’]
return gpa
for I in range(num_students):
print(f”\nstudent {i+1}”)
name = input(“Enter student name: “)
print(f”\ncourse {j+1}”)
students.append(student)
gpa = student.calculate_gpa()
2. The approach employed in the deign of the program is a structured approach using
procedural programming. The program follows a linear sequence of steps, starting with
inputting student details, then accepting course choices, scores and credit unit for each
student, and finally calculating and storing the GPA for each student. The program uses
function like input and print statements to interact with the user and perform computations.
4. The program does not determine or identify the “best” student in the class.
It collects data for all students, calculates their respective GPAs, and stores
the information. To determine the best student, we would need to define a
criteria for determining the best, such as the highest GPA, and then iterate
over the student data to find the student(s) with the highest GPA.
5. The program consists of one main module, which includes the overall flow
of the program and the primary logic for accepting inputs, calculating GPAs,
and storing data. There are no submodules defined in the given program.
However, we can further modularize the program by encapsulating specific
functionalities into separate functions if needed (e.g) functions for input
validation , GPA calculation, etc.