Practice Problem 1: Employee Performance Tracker
Problem Statement
A company wants to automate the process of tracking performance ratings for its employees.
You are tasked with building a simple Java program that:
1. Asks the user for the number of employees.
2. For each employee:
o Takes the employee name and rating (1 to 5) as input.
o Uses switch-case to print performance category:
▪ 5 → "Outstanding"
▪ 4 → "Excellent"
▪ 3 → "Good"
▪ 2 → "Needs Improvement"
▪ 1 → "Poor"
▪ Any other input → "Invalid Rating"
o If rating is 1, skip to the next employee using continue.
3. After processing all employees:
o Calculate and print the average rating (excluding invalid and poor ratings).
o If the loop encounters a rating of 0, use break to immediately stop the process
and alert "Rating input cancelled."
Constraints
• Use appropriate data types.
• Apply loops, conditionals, switch, continue, and break appropriately.
• Validate inputs with control flow.
Sample Input/Output
Enter number of employees: 4
Employee 1 Name: Alice
Enter rating (1-5): 5
Alice - Outstanding
Employee 2 Name: Bob
Enter rating (1-5): 1
Bob - Poor
Employee 3 Name: Carol
Enter rating (1-5): 4
Carol - Excellent
Employee 4 Name: Dave
Enter rating (1-5): 0
Rating input cancelled.
Average rating (excluding poor/invalid): 4.5