007-001-014
Class Creation: Multiple Instances
Medium
Problem Description
class Creation: Multiple Instances
In this problem, you will create a program that defines a Student class with name and score fields, instantiates two separate objects via a constructor, and displays each student's information to standard output.
Learning Objective: Understand how to create multiple instances from the same class
Overview
Create multiple instances from the same class and verify they hold independent data.
Specifications
- Create a
Studentclass - Define String
nameand intscorefields - Initialize via constructor
- Create two Student instances
- Output each student's information
Output Format
Alice: 85
Bob: 92
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