![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Posts: 2
Rep Power: 0
![]() |
Help on basics
i need to incoparate the 'case' statement some where in my system that i have to create .
im producing one that , tells people how to organise a party . has any1 got an example of how at some point in the flow diagram i would incoparate a stage where a case statement would be needed? the basics of my flow diagram at the moement consist of produce guest list Organise finance Book venue sort food/decorations its really basic but its the start. any help would be most appreciated |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Pseudocode:
while (noErrors)
Printblock (
Tasks:
1) Produce guest list
2) Organize finance
3) Books
4) Sort
}
Print (Select task to perform:)
Get (userinput)
switch (userinput)
{
case 1: guestList (); break;
case 2: finance (); break;
case 3: books (); break;
case 4: sort (); break;
default: Print ("Bad input");
noErrors = false;
}
}
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 | |
|
Expert Programmer
|
Quote:
|
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Feb 2006
Posts: 2
Rep Power: 0
![]() |
thankx Dawei , and i have the choice to use pseudo code . or make a flow diagram , just trying to work out how and where to post on this forum . would you lot recomend using a flow diagram ?
i mean i have been told to make sure that i start with 5 steps and from those branche of into 5 more and so on but no more than 5 . for example as i have opted to do the system where it has to teach somebody how to plan and run a party. it would go as followed Produce guest list - have you produced a guest list = if no then ( at this point i need it to go back and repeat the question until completed this task). once yes has been selcted then have invites been produced if no then produce them . have replies been retrieved if yes then have you got a total guest list count. thats really basic but im relaly just strating out so i guess its going to be like that. Thats just for the guest list part , i still have yet to cover other parts (venue,food/drink,finance) i have also been old to use compound and nested statements , any1 with brief knowledge of these , as mine is non existent at the moe . also i got to many if statements going on anyway to get rid of these ? .. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|