Skip to content

SKILL CHECK 2: Basics Assessment

Seanti edited this page Mar 26, 2025 · 1 revision

2nd Skill Check: Student Subject Enrollment System

Problem:

Create a student subject enrollment system that:

  1. Uses an array to store student subjects.

  2. Uses a loop to allow multiple subject entries.

  3. Uses a method to calculate the total tuition fee (₱1,500 per subject).

  4. Uses a switch statement to allow the student to choose a payment method.

  5. Uses try-catch to handle invalid inputs.

  6. Asks the user if they want to enroll again (loop retry option).


Sample Outputs:

Successful Enrollment:

Enter student name: Juan Dela Cruz  
Enter number of subjects to enroll: 3  

Enter subject 1: Math  
Enter subject 2: Science  
Enter subject 3: English  

You have enrolled in: Math, Science, English  
Total tuition fee: ₱4,500  

Choose a payment method:  
1 - Cash  
2 - Credit Card  
3 - Installment  
Enter your choice: 1  
Payment method selected: Cash  

Do you want to enroll another student? (yes/no): no  
Thank you for enrolling!

Invalid Input Handling:

Enter student name: Pedro Reyes  
Enter number of subjects to enroll: abc  
Invalid input! Please enter a valid number.  
Enter number of subjects to enroll: 2  

Enter subject 1: History  
Enter subject 2: PE  

You have enrolled in: History, PE  
Total tuition fee: ₱3,000  

Choose a payment method:  
1 - Cash  
2 - Credit Card  
3 - Installment  
Enter your choice: 5  
Invalid choice! Please enter 1, 2, or 3.  
Enter your choice: 2  
Payment method selected: Credit Card  

Do you want to enroll another student? (yes/no): yes  

Concepts Used in Final Problem:

Switch Statement → Payment method selection
Methods → Tuition fee calculation
Loops → Subject entry & retry option
Arrays → Storing subject names
Try-Catch → Handling invalid inputs

Clone this wiki locally