Skip to content

Commit e6702f0

Browse files
committed
feat: Identify topper among multiple students using object-oriented approach
🧠 Logic: - Defines a class `SolveIT` with fields: roll number, name, and percentage, and methods to input (`getData`) and output (`display`) student details. - In the `Student` class (main driver), takes input for the number of students. - Creates an array of `SolveIT` objects, collects data for each student, and displays it. - Iterates through all students to determine the one with the highest percentage and stores their position. - Finally, prints the topper’s details by accessing the object at the stored index. Signed-off-by: Somesh diwan <[email protected]>
1 parent f79adb2 commit e6702f0

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Section8LoopAB/Loop 2.O/src/Solve/SolveIT1.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public static void main(String[] args) {
3232
pos = i;
3333
}
3434
}
35-
3635
System.out.println("Topper is:");
3736
s[pos].display();
3837
}

0 commit comments

Comments
 (0)