007-004-005
Class Aggregation: Student List
Easy
Problem Description
class Aggregation: Student List
In this problem, you will create a program that reads student names and scores from standard input, stores them in an array of Student class objects, and displays each student's information in the specified format to standard output.
Learning Objective: Manage multiple objects in array collectively
Create program managing multiple student information. Store Student class objects in array and display information.
Input
Line 1: Student count (integer)
Line 2 onwards: Name and score (string and integer, multiple lines)
Output
[name1]: [score1] points
[name2]: [score2] points
...
Examples
Example 1: 2 students
Input:
2
Taro 85
Hanako 90
Output:
Taro: 85 points
Hanako: 90 points
Example 2: 3 students
Input:
3
A 70
B 80
C 75
Output:
A: 70 points
B: 80 points
C: 75 points
Example 3: 1 student (boundary)
Input:
1
X 100
Output:
X: 100 points
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up