English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

this structured pseudocode should described how my paycheck is calculated. is got to have at least two decisions.

input hourlyPayRate
input hoursWorked
input percentageGrossSalaryWithheld
if an employee an has worked over 40 hours then
pay him time and have for hours worked over 40
else
paying him regular time
endif
if a raise has been giving then
increased withholdingAmount
else
let grossPay = hourlyPay * hoursWorked
let withholdingAmount = grossPay * percentageGrossSalaryWithheld
let netPay = withholdingAmount - grossPay
endif
stop

2007-09-07 06:29:42 · 3 answers · asked by caleb 1 in Social Science Psychology

3 answers

First, use the names of your data elements. For example, instead of saying "if an employee has worked over 40 hours", say "if hoursWorked is greater than 40".

Second, instead of saying "time and have" ("time-and-a-half"?), say "1.5 times hourlyPayRate".

Third, how do you know "if a raise has been giving (sic)"? I don't see an input data element for that information.

Fourth, since you have a "stop" statement, shouldn't you have a corresponding "start" statement?

.

2007-09-07 06:42:53 · answer #1 · answered by ? 7 · 0 0

widely used comments: Use indentation to make sparkling which good judgment is component to the IF and ELSE statements improve some strains somewhat greater. do not say "Pay him prevalent time", supply somewhat ingredient approximately a thank you to compute prevalent pay. Ditto for the extra time block. The strengthen good judgment could desire to look previously you compute prevalent or extra time pay, on account that (assuming the strengthen has taken consequence) it is going to influence how plenty pay you get. ultimately, the final few strains (different than the stop stmt) are computing gross and internet pay, which you propose you're doing interior the 1st IF assertion. Do you ought to compute it two times? Oh - and it extremely is "time and a a million/2", not "time and a have". Compilers can not wager at detrimental spelling.

2016-10-18 05:52:09 · answer #2 · answered by ? 4 · 0 0

Just a guess--line 4: extra word
line5: misspelled word

2007-09-07 06:35:00 · answer #3 · answered by ponyboy 81 5 · 0 0

fedest.com, questions and answers