أهاوية

02-03-2009, 10:44 PM

مرحبا ممكن تساعدوني فحلها بليييييز بسرعة:s7:

(Algorithm)

Every salesperson has a base salary

Salesperson receives $10 bonus at the end of the month for each year worked if he or she has been with the store for five or less years

The bonus is $20 for each year that he or she has worked there if over 5 years

:Additional bonuses are as follows

If total sales for the month are $5,000-$10,000, he or she receives a 3% commission on the sale

If total sales for the month are at least $10,000, he or she receives a 6% commission on the sale

Get baseSalary

Get noOfServiceYearsCalculate bonus using the following formula

(if (noOfServiceYears is less than or equal to five

bonus = 10 * noOfServiceYears

otherwise

bonus = 20 * noOfServiceYears

Get totalSale

Calculate additionalBonus as follows:

if (totalSale is less than 5000

(additionalBonus = 0

otherwise

5000 if (totalSale is greater than or equal to

( and totalSale is less than 10000

( additionalBonus = totalSale · (0.03

otherwise

(additionalBonus = totalSale · (0.06

Calculate payCheck using the equation

payCheck = baseSalary + bonus + additionalBonus

(Algorithm)

Every salesperson has a base salary

Salesperson receives $10 bonus at the end of the month for each year worked if he or she has been with the store for five or less years

The bonus is $20 for each year that he or she has worked there if over 5 years

:Additional bonuses are as follows

If total sales for the month are $5,000-$10,000, he or she receives a 3% commission on the sale

If total sales for the month are at least $10,000, he or she receives a 6% commission on the sale

Get baseSalary

Get noOfServiceYearsCalculate bonus using the following formula

(if (noOfServiceYears is less than or equal to five

bonus = 10 * noOfServiceYears

otherwise

bonus = 20 * noOfServiceYears

Get totalSale

Calculate additionalBonus as follows:

if (totalSale is less than 5000

(additionalBonus = 0

otherwise

5000 if (totalSale is greater than or equal to

( and totalSale is less than 10000

( additionalBonus = totalSale · (0.03

otherwise

(additionalBonus = totalSale · (0.06

Calculate payCheck using the equation

payCheck = baseSalary + bonus + additionalBonus