PRACTICUM
Assignment Week 4
1 Dataset
The dataset used in this practicum contains information about several employees, including their name, age, salary, position, and performance level.
| No | Name | Age | Salary | Position | Performance |
|---|---|---|---|---|---|
| 1 | Bagas | 25 | 5000 | Staff | Good |
| 2 | Joan | 30 | 7000 | Supervisor | Very Good |
| 3 | Alya | 27 | 6500 | Staff | Average |
| 4 | Dwi | 35 | 10000 | Manager | Good |
| 5 | Nabil | 40 | 12000 | Director | Very Good |
2 Conditional Statement
In this section, a conditional statement is used to calculate the bonus received by each employee based on their performance level.
| No | Name | Age | Salary | Position | Performance | Bonus |
|---|---|---|---|---|---|---|
| 1 | Bagas | 25 | 5000 | Staff | Good | 500 |
| 2 | Joan | 30 | 7000 | Supervisor | Very Good | 1400 |
| 3 | Alya | 27 | 6500 | Staff | Average | 325 |
| 4 | Dwi | 35 | 10000 | Manager | Good | 1000 |
| 5 | Nabil | 40 | 12000 | Director | Very Good | 2400 |
3 For Loop
In this section, a for loop is used to filter and display employees who have a salary greater than 6000.
| No | Name | Age | Salary | Position | Performance | Bonus |
|---|---|---|---|---|---|---|
| 1 | Joan | 30 | 7000 | Supervisor | Very Good | 1400 |
| 2 | Alya | 27 | 6500 | Staff | Average | 325 |
| 3 | Dwi | 35 | 10000 | Manager | Good | 1000 |
| 4 | Nabil | 40 | 12000 | Director | Very Good | 2400 |
4 While Loop
In this section, a while loop is used to display employee data sequentially until the position “Manager” is found.| No | Name | Age | Salary | Position | Performance | Bonus |
|---|---|---|---|---|---|---|
| 1 | Bagas | 25 | 5000 | Staff | Good | 500 |
| 2 | Joan | 30 | 7000 | Supervisor | Very Good | 1400 |
| 3 | Alya | 27 | 6500 | Staff | Average | 325 |
| 4 | Dwi | 35 | 10000 | Manager | Good | 1000 |
5 Break Statement
In this section, the break statement is used to stop the loop when an employee with a salary greater than 10000 is found.| No | Name | Age | Salary | Position | Performance | Bonus |
|---|---|---|---|---|---|---|
| 1 | Bagas | 25 | 5000 | Staff | Good | 500 |
| 2 | Joan | 30 | 7000 | Supervisor | Very Good | 1400 |
| 3 | Alya | 27 | 6500 | Staff | Average | 325 |
| 4 | Dwi | 35 | 10000 | Manager | Good | 1000 |
6 Continue / Next Statement
In this section, the next statement is used to skip employees whose performance is categorized as “Average”.| No | Name | Age | Salary | Position | Performance | Bonus |
|---|---|---|---|---|---|---|
| 1 | Bagas | 25 | 5000 | Staff | Good | 500 |
| 2 | Joan | 30 | 7000 | Supervisor | Very Good | 1400 |
| 3 | Dwi | 35 | 10000 | Manager | Good | 1000 |
| 4 | Nabil | 40 | 12000 | Director | Very Good | 2400 |
7 Data Visualizations
This section presents several visualizations to better understand the employee dataset. The visualizations help illustrate the distribution of salaries, employee performance, and the relationship between variables in the dataset.
7.1 Bar Chart (Salary Distribution)
7.2 Pie Chart (Performance Distribution)
7.3 Scatter Plot (Age vs Salary)
8 Interpretation
Based on the analysis conducted in this practicum, it can be seen that employee performance has a relationship with the bonus received. Employees with “Very Good” performance receive a higher bonus compared to those with “Good” or “Average” performance.
In addition, the use of conditional statements and loops helps process and filter employee data more efficiently. For example, the for loop is used to identify employees with salaries greater than 6000, while the while loop stops the process once a manager position is found. The break and next statements also help control the flow of the program, allowing certain conditions to stop or skip the iteration.
The visualizations also help provide a clearer understanding of the dataset. The bar chart illustrates the differences in salary among employees, while the pie chart shows the distribution of employee performance levels. Meanwhile, the scatter plot presents the relationship between age and salary, giving a simple overview of how employee characteristics relate to their compensation.
Overall, this practicum demonstrates how basic programming structures such as conditional statements, loops, and data visualization can be applied to analyze and manage simple datasets.