Two Laptop Bag*
The moose likes Beginning Java and the fly likes Pseudocode and clueless Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Pseudocode and clueless" Watch "Pseudocode and clueless" New topic
Author

Pseudocode and clueless

Juliet Bravo
Greenhorn

Joined: Dec 26, 2010
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
Sheriff

Joined: Sep 28, 2004
Posts: 18545
    
  40

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

Joined: Dec 26, 2010
Posts: 2
Thanks a lot Henry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pseudocode and clueless
 
Similar Threads
Else without if error
Need help with structure...
Accepting Numeric User Input
neep help
Scope issues