Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-30-2012, 11:20 AM   PM User | #1
lukeey93
New to the CF scene

 
Join Date: May 2012
Location: United Kingdom
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
lukeey93 is an unknown quantity at this point
Really need some help with Pseudocode

Hi all,

I need to produce pseudocode for restaurant procedures such as allocating tables, booking a table and general processes such as this.

Here is one I have done already, any examples or ideas would be great.

Code:
Declarations
boolean foodAvailability string foodChoice

input foodChoice
if (foodAvailability = 0)
{
display message ‘Food is not available’
}
else prompt next choice
lukeey93 is offline   Reply With Quote
Old 05-30-2012, 12:00 PM   PM User | #2
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
I would change how you are checking food, there is a much simpler way. Generic lists are very powerful. I have no clue what language you are working in but consider the following
Code:
List<string> foodAvail = new List<string>();
......
//somewhere else you can have an entry screen or something to add food to that list, 
//or even add it in the declaration
......
//adding and removing from the list is easy... pretend "apple" and "grape" are in the list
foodAvail.Remove("apple");
foodAvail.Add("steak");
........
//you can then just do .contains
if( foodAvail.Contains(something))
  {
  //todo
  }
will be a lot simpler. Do you have a database to work with? or just runtime variables? if you have no database then I would suggest making a dataset for all you 'stuff' if you do have a database I would suggest making a dataset for all your 'stuff' and populate it as needed (and hit the database as needed too for updates and what-not). This is all .net ideology- but Java has a lot of the same things, just called different things and somewhat different declarations/syntaxes
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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


All times are GMT +1. The time now is 10:52 AM.


Advertisement
Log in to turn off these ads.