-
Notifications
You must be signed in to change notification settings - Fork 0
SKILL CHECK 2: Basics Assessment
Seanti edited this page Mar 26, 2025
·
1 revision
Create a student subject enrollment system that:
-
Uses an array to store student subjects.
-
Uses a loop to allow multiple subject entries.
-
Uses a method to calculate the total tuition fee (₱1,500 per subject).
-
Uses a switch statement to allow the student to choose a payment method.
-
Uses try-catch to handle invalid inputs.
-
Asks the user if they want to enroll again (loop retry option).
✅ 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
✔ Switch Statement → Payment method selection
✔ Methods → Tuition fee calculation
✔ Loops → Subject entry & retry option
✔ Arrays → Storing subject names
✔ Try-Catch → Handling invalid inputs