programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering OS Languages Paradigms IDEs Build Tools Frameworks Products This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

# Pseudocode and clueless

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 ?

author
Sheriff
Posts: 23295
125
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