Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
27 views

Studentscore - F: Question Text: Title: Student Management

The document describes creating two classes - Student and Department - to manage student data. The Student class contains attributes for a student's ID, name, enrolled course, and score. The Department class contains attributes for the department name and a list of Student objects. It describes defining initialization methods for each class. It also describes two methods for the Department class - findCourseWiseStudents returns a dictionary with course names and student counts, and findStudentGrade takes a student ID and returns the student's grade based on their score.

Uploaded by

Sandhya Ganesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Studentscore - F: Question Text: Title: Student Management

The document describes creating two classes - Student and Department - to manage student data. The Student class contains attributes for a student's ID, name, enrolled course, and score. The Department class contains attributes for the department name and a list of Student objects. It describes defining initialization methods for each class. It also describes two methods for the Department class - findCourseWiseStudents returns a dictionary with course names and student counts, and findStudentGrade takes a student ID and returns the student's grade based on their score.

Uploaded by

Sandhya Ganesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Question Text:

Title: Student Management

Create a class Student with below attributes:


studentId - String
studentName – String
courseEnrolled - String
studentScore - float

Where , studentId represents student id, studentName represents student name, courseEnrolled
represents the name of the course enrolled for and studentScore represents the score for the
student.

Define the __init__ method to initialize the attributes in the above sequence.

Create a class Department with below attributes:


departmentName – String
studentList – list of Student type

Where , the departmentName represents the name of the department and studentList represents
the list of Students.
Define the __init__ method to initialize the attribuutes in the above sequence.
Define two methods – findCourseWiseStudents and findStudentGrade in Department class.

findCourseWiseStudents:
This method will find the count of students enrolled for each course from the studentList of the
Department class and returns a dictionary having the courseEnrolled and studentCount (count of
students) as key:value pair.

findStudentGrade:
This method will take a studentId as parameter and return the grade of the Student with the
given studentId passed as argument from the studentList in the Department class.
The grade is calculated based on the studentScore as below:

If the studentScore >= 80 , grade should be 'A'.


If the studentScore<80 and >=65 , grade should be 'B'
If the studentScore<65 and >=55, grade should be 'C'
otherwise grade should be 'F'

If no student with given student id found in the studentList , the method should return None.
These methods should be called from the main section.

You might also like