Using Flowchart and Pseudo Code and a single real example (trace), please solve the following problems:
1. Payroll Computation
Compute the monthly salary for each of the 200 employees in a company assuming the formula for computing is as follows
Salary = Basic Salary + Allowances - Deductions
Sure, let's solve the problem using a flowchart and pseudo code, and then provide a single real example trace.
Flowchart:
1. Start
2. Initialize variables: Basic Salary, Allowances, Deductions, Salary
3. For each employee:
4. Input Basic Salary, Allowances, Deductions
5. Compute Salary: Salary = Basic Salary + Allowances - Deductions
6. Output Salary
7. Stop
Pseudo code:
1. Start
2. For each employee:
3. Input Basic Salary, Allowances, Deductions
4. Compute Salary: Salary = Basic Salary + Allowances - Deductions
5. Output Salary
6. Stop
Now let's provide a single real example trace for a specific employee:
Assuming:
- Basic Salary = $5000
- Allowances = $1000
- Deductions = $500
Trace:
1. Start
2. For employee 1:
3. Input Basic Salary = $5000, Allowances = $1000, Deductions = $500
4. Compute Salary: Salary = $5000 + $1000 - $500 = $5500
5. Output Salary = $5500
6. Stop
By repeating this process for each employee (200 employees in this case), you will be able to compute the monthly salary for all the employees in the company.