Computer Science Canada resturant sysyem !!!!!!!!! |
Author: | samsungsam [ Sat Oct 31, 2009 3:19 pm ] | ||
Post subject: | resturant sysyem !!!!!!!!! | ||
things that i don't know how to make: after u choose a item make it include tax
|
Author: | samsungsam [ Sat Oct 31, 2009 3:23 pm ] |
Post subject: | Re: resturant sysyem !!!!!!!!! |
after i choose food menu whice code that i can use and make it turn back to the first menu Ryan's menu >food menu food menu > Ryan's Menu should i use loop or if,end if or array? show me a example plz |
Author: | Superskull85 [ Sat Oct 31, 2009 5:56 pm ] | ||||||||||||
Post subject: | Re: resturant sysyem !!!!!!!!! | ||||||||||||
I think your best bet for adding tax is to use either an array filled with a record, or parallel arrays (not recommended, but if you have not learned how to use records, this might be what your teacher wants). So either:
Or:
If you wanted to separate the foods into categories dynamically you could add another field to the record, or another parallel array. Either way you can output the menu using a counted loop:
And separate the items by category statically (for example, going from 1 to 9 for sandwiches), or dynamically checking a "category" field. If you put the menu into an array than the number the user enters becomes the index where the food is in the array, so just use something like:
To go back to the Ryan's Menu -> Menu, or Menu -> Ryan's Menu, you need to embedded loops. The outer most loop would be your main loop (only broken when the user wants to exit) and the inner most loops would be used for each menu. So:
You could use an if statement, and a "state" variable, to change between different menus. So:
I hope that helps. ![]() |
Author: | S_Grimm [ Sat Oct 31, 2009 8:26 pm ] |
Post subject: | RE:resturant sysyem !!!!!!!!! |
id look into switch case statements depending on which menu they wanted (ie a case for drinks, a case for desserts, a case for main course, a case for appetizers, etc etc etc) mind you i cant remember the turing switch/case statement layout so im not even going to attempt to post any code for it |
Author: | Superskull85 [ Sun Nov 01, 2009 12:22 am ] | ||
Post subject: | RE:resturant sysyem !!!!!!!!! | ||
You could use case statement for states like this:
But it doesn't really matter if you use an if statement, or case statement, as they accomplish similar goals. If statements are more flexible in terms of what you can do, so I tend to stick with them. Turing does not "cascade" to subsequent branches in a case statement, so other than shortening code, they really don't have to much use over if statements. |
Author: | samsungsam [ Sun Nov 01, 2009 9:04 pm ] |
Post subject: | Re: resturant sysyem !!!!!!!!! |
Thank you Supperskull85 ![]() your post help me alot thanks!!!!!!!! |
Author: | gianni [ Sun Nov 01, 2009 9:07 pm ] |
Post subject: | RE:resturant sysyem !!!!!!!!! |
Please double-check your title and post, poor spelling makes me less inclined to assist you. |
Author: | samsungsam [ Sun Nov 01, 2009 9:13 pm ] |
Post subject: | Re:Wrong Spelling |
Still Need Help gianni wrote: Please double-check your title and post, poor spelling makes me less inclined to assist you. Sorry! i mean Restaurant System !!!!!!!!! |
Author: | samsungsam [ Sun Nov 01, 2009 9:20 pm ] |
Post subject: | Re: restaurant system !!!!!!!!! |
Still Need Help |
Author: | samsungsam [ Sun Nov 01, 2009 9:20 pm ] |
Post subject: | Re: restaurant system !!!!!!!!! |
still need help |
Author: | samsungsam [ Sun Nov 01, 2009 9:23 pm ] |
Post subject: | Re: restaurant system !!!!!!!!! |
how do i combine array for menu and menu project 2-choice together menu project-choice + array for menu when i combine them together it is an error can any one help me fix it? plz |
Author: | rdrake [ Sun Nov 01, 2009 10:57 pm ] |
Post subject: | RE:resturant sysyem !!!!!!!!! |
If I'm not mistaken you can edit your post until somebody has replied to it. Incidentally somebody did reply to your last 3 posts, albeit it was you. Quadruple, let alone triple, let alone double posts are frowned upon here. Please exercise patience, particularly since your past 4 posts were within 10 minutes of one another. |
Author: | Superskull85 [ Mon Nov 02, 2009 11:37 am ] | ||
Post subject: | Re: restaurant system !!!!!!!!! | ||
samsungsam @ Sun Nov 01, 2009 9:23 pm wrote: how do i combine array for menu and menu project 2-choice together
menu project-choice + array for menu when i combine them together it is an error can any one help me fix it? plz Well you should list how you want the program to function first. An example:
If the user chose to see the order menu, delete the main menu and show order menu Ask the user how many items they want to order. Get those items. Find the price of those items by comparing the users choices with the order menu. Calculate the tax per item, and than calculate the total. Complete order. By following a plan like the above you should be able to complete the program. You know that the main menu needs to exist in a loop. Inside that loop you get the users input, and determine the current state of the program. Within the "order menu" state you need to display the order menu, ask the user how many items they want, etc. It would look something like this:
Use a model similar to this and you should be able to do what you want. ![]() |
Author: | samsungsam [ Mon Nov 02, 2009 1:11 pm ] | ||
Post subject: | Re: resturant sysyem !!!!!!!!! | ||
samsungsam @ Sun Nov 01, 2009 9:23 pm wrote: how do i combine array for menu and menu project 2-choice together
menu project-choice + array for menu when i combine them together it is an error can any one help me fix it? plz Well you should list how you want the program to function first. An example:
If the user chose to see the order menu, delete the main menu and show order menu Ask the user how many items they want to order. Get those items. Find the price of those items by comparing the users choices with the order menu. Calculate the tax per item, and than calculate the total. Complete order. By following a plan like the above you should be able to complete the program. You know that the main menu needs to exist in a loop. Inside that loop you get the users input, and determine the current state of the program. Within the "order menu" state you need to display the order menu, ask the user how many items they want, etc. It would look something like this:
Use a model similar to this and you should be able to do what you want. ![]() [/quote] sorry, but i don't get what you mean. can you be more detail plz? can you put a running total in it? ----------------------------------------------------------------------- main menu -1. food menu -how many you want -receipt -how many tips do they want to pay -2. total sale -show how many item you sale($) tax and tips not include -3. tips (running total) -how many tips($) you get -4. tax (running total ) -how many tax$($) money -5. grand total -total sale + tips + tax -6. exit ----------------------------------------------------------------------- That is actually what i suppose to make |
Author: | Superskull85 [ Mon Nov 02, 2009 6:18 pm ] | ||
Post subject: | RE:resturant sysyem !!!!!!!!! | ||
The idea is to use a similar model to the one I outlined, and to program each individual parts of the program. I will not do your assignment for you. That being said, I would be willing to help you out, if you at least attempt a solution. Your "MENU PROJECT2.t" file already has basic functionality for displaying the main menu, displaying the order menu if the user wants to see it, asking the user for the number of items they wish to order, asking for those items and getting those items. What you need to do now is figure out the prices for each item the user enters. This can be done using a for loop and some if statements. The for loop would iterate through each item the user entered (the array "item" in the file I mentioned), and checking those item to see if they match a choice in your order menu. For example, one of the if statements could be:
Than all you have to do is complete the order. If you need to calculate total tax than multiply each price by (TaxPercentage / 100) and add that to the total tax. Tips can be incorporated by asking if the user wants to give a tip upon completion of the order, and adding that to the tip total. |
Author: | andrew. [ Mon Nov 02, 2009 6:42 pm ] |
Post subject: | RE:resturant sysyem !!!!!!!!! |
Write down on paper, step-by-step what you want to do. Make sure you include everything like getting the input from a user and printing something. Use plain English and get it organized in a procedural fashion (going step-by-step). Then after you are done, try turning it into Turing code. |
Author: | samsungsam [ Mon Nov 02, 2009 10:09 pm ] | ||
Post subject: | Re: resturant sysyem !!!!!!!!! | ||
Superskull85 wrote: The idea is to use a similar model to the one I outlined, and to program each individual parts of the program. I will not do your assignment for you. That being said, I would be willing to help you out, if you at least attempt a solution. Your "MENU PROJECT2.t" file already has basic functionality for displaying the main menu, displaying the order menu if the user wants to see it, asking the user for the number of items they wish to order, asking for those items and getting those items. What you need to do now is figure out the prices for each item the user enters. This can be done using a for loop and some if statements. The for loop would iterate through each item the user entered (the array "item" in the file I mentioned), and checking those item to see if they match a choice in your order menu. For example, one of the if statements could be:
Than all you have to do is complete the order. If you need to calculate total tax than multiply each price by (TaxPercentage / 100) and add that to the total tax. Tips can be incorporated by asking if the user wants to give a tip upon completion of the order, and adding that to the tip total. What does the i deside the item mean ? item[i] |
Author: | Tony [ Mon Nov 02, 2009 10:15 pm ] |
Post subject: | RE:resturant sysyem !!!!!!!!! |
Array's index. |
Author: | Superskull85 [ Mon Nov 02, 2009 11:02 pm ] | ||||
Post subject: | RE:resturant sysyem !!!!!!!!! | ||||
Slight error in my post. This code:
Should be:
Accidentally mixed in some Java, sorry. ![]() |
Author: | samsungsam [ Tue Nov 03, 2009 1:39 pm ] |
Post subject: | Re: resturant sysyem !!!!!!!!! |
how can i add running total var sub :real :=0.00 sub + 1 is that a error? i want to make it like var sub :real :=0.00 sub + 1 var sub :real :=1.00 |