Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic .NET (http://www.programmingforums.org/forum19.html)
-   -   Assignment, asking for help (http://www.programmingforums.org/showthread.php?t=6066)

JimR Sep 24th, 2005 7:57 PM

Assignment, asking for help
 
I would like to know if I'm getting close to writing the pseudocode for the assignment below. Any help would be greatly Appreciated.



Assignment:
Use both a selection structure and a repetition structure.

Write the pseudocode

Your company wants a list of each employee who worked overtime during the previous pay period. You should read the name, employee ID number and hours worked from a file. Select and print the records that have hours greater than 40.


My Pseudocode:

Quote:

Start

Get employeeList

Print employeeList

Get First employeeName

Print First employeeName

while NOT eof

if hoursWorked > 40

during previous pay period

list employeeRecords

else

get next employeeName

endif

endwhile

Print employeeRecords

employeeName employeeIdNo hoursWorked

Print employeeName employeeIdNo hoursWorked


Stop

OpenLoop Sep 25th, 2005 9:06 AM

I'm not a Pseudo code expert but i think you need to put more detail in there. I don't see where you opened the file and closed it.

linuxpimp20 Sep 25th, 2005 9:21 AM

i think your also supposed to indent it like you would the program but not postive.

tempest Sep 25th, 2005 10:10 AM

I always thought psuedo-code was pointless, i just turned in classic BASIC and my teacher didn't mind...

JimR Sep 25th, 2005 10:56 AM

Quote:

Originally Posted by OpenLoop
I'm not a Pseudo code expert but i think you need to put more detail in there. I don't see where you opened the file and closed it.

Thank you for responding to my post. I understand what you are saying, I"m not sure where to position and show the files being opened and then closed. This is what I have come up with so far.

Start

Open files read empRecord

Get employeeRecord

Print employeeRecord

Get First employeeName

Print First employeeName

while NOT eof

if hoursWorked > 40

during previous pay period

Print empRecord
Close files

else

get next employeeName

endif

endwhile

Read empRecord

empName empIdNo hoursWorked

Print empName empIdNo hoursWorked


Stop

JimR Sep 25th, 2005 11:01 AM

Quote:

Originally Posted by linuxpimp20
i think your also supposed to indent it like you would the program but not postive.

Thank you for your reply. I had my pseudocode indented in my MS word program but when I copied in into my post it removed the pseudocode format I had. Any ideas on how to get it back would be appreciated.

Jim R

JimR Sep 25th, 2005 11:09 AM

This class starts out with learning to pseudocode, and I do not have any experience in programing so I wouldn't now how to write the code. I beleive after this class tomorrow it will be my 5th class and then we will start using the Microsoft Visual Basic .Net RELOADED by Diane Zak.
Thank you for your response.

Jim R

Ithaqua Oct 23rd, 2005 4:01 AM

Quote:

Start

Get employeeList

Print employeeList

Get First employeeName

Print First employeeName

while NOT eof

if hoursWorked > 40

during previous pay period

list employeeRecords

else

get next employeeName

endif

endwhile

Print employeeRecords

employeeName employeeIdNo hoursWorked

Print employeeName employeeIdNo hoursWorked


Stop
In line 3 why do you print the Employee list?
In line 8
Quote:

during previous pay period
What does this mean and why is it there?
I would change
Quote:

list employeeRecords
to add to employeeRecords.

coldDeath Oct 23rd, 2005 4:30 AM

Don't use MS-Word to program it adds unecessary BS to the file.
Get Vi or Emacs, hell even notepad is better than word.

NotePad 2 might be worth looking into.

Polyphemus_ Oct 23rd, 2005 5:05 AM

Quote:

Originally Posted by coldDeath
NotePad 2 might be worth looking into.

or notepad.. it's fine for small programs, or parts of a big program when you're at school ;)


All times are GMT -5. The time now is 11:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC