Monday 28 October 2024

Develop a python program using class concept to display student details.



First of all we have to write an algorithm for the same:

Step1: Start
Step2: Accept student details from the user.
Step3: Find out the total of all three subjects.
Step4: Find out the percentage of marks.
Step5: Show the student information.
Step6: Stop

As we know we are implementing this assignment by using the concept of class are as follows:

Created class student with parameterized constructor.
Five data members with public access specifier. One show_student( ) method to display student information, accept_info( ) method to accept all details of students from the user at runtime, find_total() method to find total of three subjects, find_percentage() method to compute percentage of marks.



Line no 43 we have created one object s1 of student with details. so when object is going to be created the memory is going to be allocated for particular object and then corresponding methods are going to be called for that object.

After Executing this code you will see the output like this:



data structures and algorithms Web Developer

No comments:

Post a Comment