-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpseudocode for productivity score bonus .txt
108 lines (64 loc) · 2.38 KB
/
pseudocode for productivity score bonus .txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
question
pseudocode for a program that accepts each salesperson’s data and displays the name and a bonus amount.
The client confirmed the bonuses will be distributed as follows:
If the productivity score is 30 or less, the bonus is R25.
If the productivity score is 31 or more and less than 80, the bonus is R50.
If the productivity score is 80 or more and less than 200, the bonus is R200.
If the productivity score is 200 or higher, the bonus is R200.
start
Declaration
string [] salesperson’s = new string [40]
num count
string input
string name
string lastName
num shiftsWorked
num transactions
num randValue
set count = 0
while (salesperson’s < 40)
output "Enter your first name"
names = ReadLine()
output "Enter you last name"
lastName = ReadLine()
output " how many shift were taken in a month"
shiftsWorked = Convert.ToInt32(ReadLine)
output "How many transactions were completed in a month"
transactions = Convert.ToInt32(ReadLine)
output "What is the rand value of the transactions"
randValue = Convert.ToInt32(ReadLine)
output "enter yes to continue no to exit"
input = ReadLine()
//call method
CalculateProductivityScore(randValue, transactions, shiftsWorked)
//call CalculateBonus( productivityScore)
CalculateBonus( productivityScore)
endwhile
foreach (salesperson’s in the array)
output "name:" + name + "lastName:" + lastName "Productivity score:" + productivityScore + ", " + "your bonus based on your productivity is:" + bonus
If (productivityScore >= 50)
output "***"
else
output " have a nice day"
endif
endforeach
stop
CalculateProductivityScore(randValue, transactions, shiftsWorked)
Declaration
num productivityScore
productivityScore = (randValue / transactions) / shiftsWorked
return productivityScore
CalculateBonus( productivityScore)
Declaration
num bonusZero = 0
num bonusOne = 50
num bonusTwo = 200
if (productivityScore >= 31)
bonus = bonusOne
else if (productivityScore >= 80)
bonus = bonusTwo
else if (productivityScore >= 200 )
bonus = bonusTwo
else
bonus = bonusZero
return bonus