Jump to content

Pseudocode Help, Very Easy, Just not for me!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Techage

Techage

    Newbie

  • Members
  • Pip
  • 1 posts
Ok I'm deffinatly not sure if I should post this here, but I have looked all over for help and can't find a thing! I'm currently enrollled in a Programming Logic and Design course, we have only read 3 chapters, and the teacher wnats us to write pseudocode. I don't know how to do any of this! I'm read these chapters so many times and I understand how to read the pseudocode, and even can find errors, but I just can't figure out how to start from scratch! Soo I need some help on this, I'm not asking for the answer, just maybe how to start? I'd really appreciate it.





8) All in a Day’s Work is a temporary employment agency. The manager needs to determine how much tax to withhold for each employee. This withholding amount computes as 20 percent of each employee’s weekly pay. The weekly pay is the hourly pay time 40.

A) Design an interactive screen that displays an employee’s weekly pay and withholding amount. The user inputs the hourly pay rate for an employee. Draw the flowchart or write the pseudocode for this program.

B) Design a printed report titled WITHOLDING FOR EACH EMPLOYEE. Input fields include the first and last names of each employee, hourly pay, weekly pay, and withholding amount per week. Draw the flowchart or write the pseudocode for this program.

For (B) I have this, but I'm sure I did it incorrect, and I don't even know where to start on (A). I tired to get teh teacher to help me, but hes a grumpy old man and doesn't want anything to do with his students.



8 –B

Printchart:

WITHOLDING FOR EACH EMPLOYEE

LAST NAME FIRST NAME HOURLY PAY WEEKLY PAY WITHOLD

XXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXX

XXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXX

XXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXX



END OF REPORT





Pseudocode




start

                char employeeLast

                char employeeFirst

num employeeHourly

num employeeWeekly

num withHold

                string HEAD = “WITHOLDING AMOUNT FOR EACH EMPLOYEE”

                string COL_HEADS = “LAST NAME     FIRST NAME     HOURLY PAY     WEEKLY PAY     WITHOLD”

                string FOOT = “END OF REPORT”

                print HEAD

                print COL_HEADS

                get employeeLast, employeeFirst, employeeHourly, employeeWeekly, withHold

                while not eof

                                employeeWeekly = employeeHourly *40

                                withHold = employeeWeekly * .2

                                print employeeLast, employeeFirst, employeeHourly, employeeWeekly, withHold

                                get employeeLast, employeeFirst, employeeHourly, employeeWeekly, withHold

endwhile

                print FOOT

end




Like I said, thanks again.

Edited by WingedPanther, 13 February 2009 - 12:17 PM.
add code tags (the # button)


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
It looks like you have all the essential logic. I'm not sure why you're getting withHold and then calculating it, though. What parts are you uncertain about?

Also, I added code tags (the # button) to make the readability better.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog