012-001-006

Static Variable: Student ID Auto-generation

Easy

Problem Description

static variable: Student ID Auto-generation

In this problem, you will create a program that defines a static counter variable in a Student class, auto-increments it on each object instantiation to assign a unique ID, and displays the result to standard output.

Learning Objective: Auto-number with static variable

Create student management system. Use static variable to automatically assign unique ID each time new student is registered.

Input

Line 1: Student name (string)

Output

Student ID: [ID]
Name: [name]
Registered: [count] people

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