Skip to content

Practice Problem 13

Seanti edited this page Mar 26, 2025 · 1 revision

Problem:

  1. Create a Student class with attributes:

    • name (String)

    • age (int)

    • course (String)

  2. Use a constructor to initialize these values.

  3. In main(), allow the user to enter details for a student and display the information.


Sample Output:

Enter student name: Joshua Cruz  
Enter student age: 19  
Enter student course: Computer Science  

Student Registered Successfully!  
Name: Joshua Cruz  
Age: 19  
Course: Computer Science

Clone this wiki locally