We need to store details of multiple students in an array of objects. And then print the students' results.
Problem Description: We will take the students' details, (roll number, name, marks in physics, chemistry and maths) from users for multiple students as required by users. And the print the result that displays student's roll number, name and percentage ( sum of all marks / 300 * 100).
Algorithm:
- Step 1: Create a class named Student to store student information.
- Step 2: Take inputs from the user, and store it into an array of objects using getStudentInfo() method.
- Step 3: After the user has entered all student's information. Print the result.
- Step 4: The result printed as roll number, name, and percentage using printResult() method.
Program to illustrate arrays of Objects in Python
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer