Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 24th, 2005, 7:57 PM   #1
JimR
Newbie
 
Join Date: Sep 2005
Posts: 8
Rep Power: 0 JimR is on a distinguished road
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
JimR is offline   Reply With Quote
Old Sep 25th, 2005, 9:06 AM   #2
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
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.
OpenLoop is offline   Reply With Quote
Old Sep 25th, 2005, 9:21 AM   #3
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
i think your also supposed to indent it like you would the program but not postive.
linuxpimp20 is offline   Reply With Quote
Old Sep 25th, 2005, 10:10 AM   #4
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
I always thought psuedo-code was pointless, i just turned in classic BASIC and my teacher didn't mind...
__________________

tempest is offline   Reply With Quote
Old Sep 25th, 2005, 10:56 AM   #5
JimR
Newbie
 
Join Date: Sep 2005
Posts: 8
Rep Power: 0 JimR is on a distinguished road
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 is offline   Reply With Quote
Old Sep 25th, 2005, 11:01 AM   #6
JimR
Newbie
 
Join Date: Sep 2005
Posts: 8
Rep Power: 0 JimR is on a distinguished road
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 is offline   Reply With Quote
Old Sep 25th, 2005, 11:09 AM   #7
JimR
Newbie
 
Join Date: Sep 2005
Posts: 8
Rep Power: 0 JimR is on a distinguished road
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
JimR is offline   Reply With Quote
Old Oct 23rd, 2005, 4:01 AM   #8
Ithaqua
Newbie
 
Join Date: Oct 2005
Location: The othe side
Posts: 19
Rep Power: 0 Ithaqua is on a distinguished road
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.
__________________
Cheers
Ithaqua
Ithaqua is offline   Reply With Quote
Old Oct 23rd, 2005, 4:30 AM   #9
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 3 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
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.
__________________
Join us at #programmingforums @ irc.freenode.net!

My software never has bugs. It just develops random features.
coldDeath is offline   Reply With Quote
Old Oct 23rd, 2005, 5:05 AM   #10
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 3 Polyphemus_ is on a distinguished road
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
Polyphemus_ is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:45 PM.

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