Win a copy of Penetration Testing Basics this week in the Security forum!

Pseudocode and clueless

Juliet Bravo
Greenhorn
Posts: 2
Hi all

I have been given an assignment to complete in pseudocode with a flow chart:

Employee Payroll Problem

Compute pay for an employee, the input will be:

Name of employee Emp_Nme
Employee number Emp_No
Hours worked Hrs_wkd
Hourly rate Hrly_rte

Normal working hours are 40, Overtime pay is 1.5 x hourly rate.
______________________________________________________________

The problem I am facing involves the IF statement,

I am using:

Tot_pay for total pay
OTH for overtime hours
STD_Pay for standard pay

can I do this:

IF Hours worked <=40
THEN
Tot_Pay = Hrs_wkd * Hrly_rte
ELSE
OTH = Hrs_wkd -40
STD_pay = Hrly_rte * 40
OTP = OTH(Hrly_rte * 1.5)
Tot_Pay = STD_pay + OTP

can I put four items under the ELSE statement??
Any suggestions ?

Henry Wong
author
Marshal
Posts: 21698
85
Juliet Bravo wrote:
can I do this:

IF Hours worked <=40
THEN
Tot_Pay = Hrs_wkd * Hrly_rte
ELSE
OTH = Hrs_wkd -40
STD_pay = Hrly_rte * 40
OTP = OTH(Hrly_rte * 1.5)
Tot_Pay = STD_pay + OTP

can I put four itemsunder the ELSE statement??
Any suggestions ?

Java allows the use of braces to put more than one statement in a block. Still pseudo code, but answers your question...

Henry

Juliet Bravo
Greenhorn
Posts: 2
Thanks a lot Henry