-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpsuedocode for Salespersons program .txt
79 lines (50 loc) · 1.91 KB
/
psuedocode for Salespersons program .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
question
pseudocode for a program that continuously accepts:
Each salesperson’s first and last names;
The number of shifts worked in a month;
The number of transactions completed in a month and
The Rand value of those transactions.
The program must display each salesperson’s name with a productivity score.
The productivity score must be calculated by first dividing Rands by transactions and then dividing the result by shifts worked.
If the score is 50 or higher, it must be displayed followed by three asterisks.
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)
endwhile
foreach (salesperson’s in the array)
output "name:" + name + "lastName:" + lastName "Productivity score:" + productivityScore
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