-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPaST paper Passing methods psuedocode netSalary of player.txt
56 lines (32 loc) · 1.43 KB
/
PaST paper Passing methods psuedocode netSalary of player.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
question
Write the pseudocode for an application that will pass the number of games a
player has played to a module which will calculate the net salary of a player.
A player earns R70 000 per game and as the players fall within a higher tax bracket,
they automatically pay 25% tax on their earnings. The net salary will be passed
back to the mainline logic of the application which will display the net salary of a
player.
start
Declaration
num basicSalary = 70000
num tax = 0.25
num gamesPlayed
num threshhold = 9
output "how many games have u played this year"
gamesplayed = ReadLine
//call CalculateNetSalary(gamesPlayed, threshhold, tax)
num CalculateNetSalary(gamesplayed, threshhold, tax)
//loop that checks if gamesPlayed is past threshhpld or not and displays diffrent results based off of loop condition
if (gamesplayed >= threshholdhreshold)
output " your NetSalary is: " NetSalarytax
else if (gamesPlayed <= threshhold)
output " your NetSalary is: " NetSalary
stop
// Method that Calculates the NetSalary of the player
num CalculateNetSalary(gamesplayed, threshhold, tax)
Declarations
NetSalary
if (gamesPlayed >= threshhold)
NetSalarytax = (threshhold * basic_salary) + ((games_played - threshholdhreshold) - (basicSalary - (basic * tax) ))
else
NetSalary = gamesplayed * basicSalary
return NetSalary