a- Flowchart:
+------------------------------+
| Start |
+------------------------------+
|
|
v
+------------------------------+
| Prompt user for number |
| of employees |
+------------------------------+
|
|
v
+------------------------------+
| Set total employees to 0 |
+------------------------------+
|
|
v
+------------------------------+
| Loop: |
| Prompt user for basic |
| salary |
| Calculate net salary |
| Display basic salary |
| Display net salary |
+------------------------------+
|
|
v
+------------------------------+
| Increment total employees |
+------------------------------+
|
|
v
+------------------------------+
| Ask user if there are more |
| employees |
+------------------------------+
|
+-------------------------------+
| |
| Continue loop if answer is |
| yes |
| |
+-------------------------------+
|
|
v
+------------------------------+
| Display total employees |
+------------------------------+
|
|
v
+------------------------------+
| End |
+------------------------------+
b- Pseudocode:
Prompt user for the number of employees
Set total employees to 0
Loop:
Prompt user for basic salary
Calculate net salary as basic salary - (5% of basic salary)
Display basic salary
Display net salary
Increment total employees
Ask user if there are more employees
If answer is yes, continue loop
If answer is no, exit loop
Display total employees
End
c- Python code:
# Prompt user for the number of employees
num_employees = int(input("Enter the number of employees: "))
total_employees = 0
# Loop to calculate net salary for each employee
while total_employees < num_employees:
# Prompt user for basic salary
basic_salary = float(input("Enter the basic salary: $"))
# Calculate net salary
net_salary = basic_salary - (0.05 * basic_salary)
# Display basic salary and net salary
print("Basic Salary: $", basic_salary)
print("Net Salary: $", net_salary)
# Increment total employees
total_employees += 1
# Ask user if there are more employees
more_employees = input("Are there more employees? (yes/no): ")
# If answer is no, exit loop
if more_employees.lower() == "no":
break
# Display total employees
print("Total Employees:", total_employees)
Screenshot of the output:
[image: sample_output] open