Monsieur

1070 mots 5 pages
Problem1

Prepare a payroll earnings statements. All the employees are on commission basis of 12.5% of sales. Each month, they also receive a bonus that varies depending on the profit for the month and their length of service. Sales manager calculates the bonus and enters it with the salesperson's total sales for the month. The program has to calculate taxes and retirement for the month based on the following rates:
Federal tax: 25 % state tax: 10% retirement plan 8%

Pseudocode

Program Payroll Calculation based on commission based on sales, and bonus. 1. Define commissionRate, FederalTaxRate, StateTaxRate and RetirementRate 2. getData (Total Sales, bonus) 3. assign Commission = calcComm(Total Sales) 4. assign Total Earning = Commission + Bonus 5. calcTaxes(total earning, FederalTax, StateTax ,Retirement) 6. display
End Program Payroll

================== Get income Data =============================
Function getData 1. prompt user and read Total sales and bonus
End Function getData

================== Calculate Commission =========================
Function calcComm 1. assign commission = commissionRate * Sales 2. return commission
End Function calcComm

================== Calculate Taxes ===============================
Function calcTaxes 1. assign fedTax = FederalTaxRate * Earning 2. assign stateTax = StateTaxRate * Earning 3. assign retirement = RetirementRate * earning
End Function calcTaxes
================== Print Information ================================
Function display 1. display fedTax, stateTax, retirement, total deduction, sales, commission, bonus and net earning.
End Function display
Problem 2

Write a function to compute the area and perimeter of a right angle triangle when given the length of the two smaller sides. use following formula: c2 = a2 + b2 and area = 0.5 * (a * b)

Pseudocode

Program Calculate

en relation