Computer Science Canada Need help on Resturant Menu system |
Author: | junkess [ Sat Nov 07, 2009 9:56 pm ] | ||
Post subject: | Need help on Resturant Menu system | ||
Hi. I'm trying to make a restaurant system. When you run it, it starts with the main menu. I have only worked on the Food menu option, so don't bother entering in options 2-6. The next thing that will appear is the actual food menu. Again, I have only worked on the first option, so enter in option 1. Here is one of my problems. If you noticed, I used the subtotal for a temporary answer. Meaning the program doesn't automatically add the order price with the old subtotal to get a new subtotal. I just don't know how to get it that way. Also, when you press 0 to exit, I don't know how to make a loop that goes all the way back to the main menu. The main problem is really figuring out a more efficient way to do this system because it's obviously the opposite of efficient. Also, if there is anything wrong about the program, please please please tell me. I know 100% that there is though. Thank you for all your help and tips. I appreciate it. Oh, and sorry if I am leaving out some important details you need to know. If I am, just tell me.
Please specify what version of Turing you are using 4.1.1 |
Author: | B-Man 31 [ Sun Nov 08, 2009 9:22 am ] | ||
Post subject: | Re: Need help on Resturant Menu system | ||
a couple of suggestions, one way to make it better is to have the user click on the items rather than have to select numbers, there is a great tut on Mouse.Where. As well, instead of making the user manually input the previous subtotal you could have your subtotal be:
Thats about what i can say to make it more efficient, if you want to make it look nice, dont use put statements, use Font.Draw. If you don't know how to do something, the Turing Walk Through is unbelievable for helping anyone for understanding new concepts or how they work. PS: Thanks for naming the bistro after me ![]() |
Author: | junkess [ Sun Nov 08, 2009 1:27 pm ] | ||
Post subject: | Re: Need help on Resturant Menu system | ||
B-Man 31 wrote: a couple of suggestions, one way to make it better is to have the user click on the items rather than have to select numbers, there is a great tut on Mouse.Where. As well, instead of making the user manually input the previous subtotal you could have your subtotal be:
Thats about what i can say to make it more efficient, if you want to make it look nice, dont use put statements, use Font.Draw. If you don't know how to do something, the Turing Walk Through is unbelievable for helping anyone for understanding new concepts or how they work. PS: Thanks for naming the bistro after me ![]() Thanks but no thanks, Ben. I've already read those instructions and not many of them make sense to me. And also, I was suggested by others that I should keep the input basic, which is really just only manual input. Thanks anyway. |
Author: | junkess [ Sun Nov 08, 2009 1:32 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
Can somebody still explain to me though what I should do to improve this program? I still am stuck on what to do next. A problem I still have not solved is getting the food menu order prices added up into a subtotal. If you have suggestions, please make them clear and don't suggest me to read the Turing guides. I already have and I have not understood most of what they are saying. |
Author: | Superskull85 [ Sun Nov 08, 2009 2:21 pm ] | ||||||||||
Post subject: | Re: Need help on Resturant Menu system | ||||||||||
Well B-Man 31 has already showed you how to keep track of subtotals without the user entering it themselves:
Instead of asking the user for their previous subtotal, just add the item price to the subtotal directly. If you want to improve your program (make it easier to add stuff in the future) I would look into using arrays and for loops to output menus, and check for input. Code such as this:
Can be represented as an array of real numbers:
And the users selection can be check by seeing if it is in range of the lower and upper bounds of the array:
You can also use arrays to store your menus in, and output them using a for loop:
You could also do what B-Man 31 suggested and create clickable menus. |
Author: | B-Man 31 [ Sun Nov 08, 2009 2:26 pm ] |
Post subject: | RE:Need help on Resturant Menu system |
You can also allow the user to order multiple of anything, ask the user how many of set dish, he/she would like to order. |
Author: | junkess [ Sun Nov 08, 2009 2:58 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
Okay... First of all, thanks. Second of all, if I am considering taking B-man's advice and making a click-able menu, how would I do so? I have read the Turing walk through for some extra info but I don't get really what you have to do for Mouse.Where - or whatever it's called. ![]() |
Author: | B-Man 31 [ Sun Nov 08, 2009 3:16 pm ] | ||||||
Post subject: | Re: Need help on Resturant Menu system | ||||||
junkess @ Sun Nov 08, 2009 2:58 pm wrote: Okay...
First of all, thanks. Second of all, if I am considering taking B-man's advice and making a click-able menu, how would I do so? I have read the Turing walk through for some extra info but I don't get really what you have to do for Mouse.Where - or whatever it's called. ![]() ok so for the Mouse.Where, there a 3 things you need to find out, the x position of the mouse, the y position and if the button is clicked. thats why the Mouse.Where function has 3 parameters which you have to define Here is an example to show you how that works:
so you are going to need to know the X and Y coordinates for each of your selections:
What this means if your mouse is in the box between (200,100) and (300,200) and you've clicked the mouse button then you get the choice. You need to figure out where they are for each selection. The way it is setup this could take a while, if you did use Font.Draw you could have an easier way of figuring out the coordinates because you know one set already. At the moment it would require a lot of tedious work but would improve your program greatly. And if your still having trouble with the subtotal here it is:
|
Author: | B-Man 31 [ Sun Nov 08, 2009 3:39 pm ] | ||
Post subject: | Re: Need help on Resturant Menu system | ||
junkess @ Sun Nov 08, 2009 3:24 pm wrote: Alright, I came up with another problem. I don't know how to fix this error. Here is the attachment to my latest Menu program. Thanks. Oh and B-man, I'm working on learning the mouse stuff. Thanks for all your help so far.
Replace the current parts witht these:
***You were quite close, they were just syntax errors and not coding issues except for the last part (the if statement) |
Author: | junkess [ Sun Nov 08, 2009 3:47 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
Alright B-man, I'm working on it so thanks. And the example you showed me up there ^ (for the Mouse.Where) ... If I click the button (rectangle), It adds more than just 2.50 because the computer adds more than one order due to my hold time during the time I press the mouse button and get my finger off the mouse button. Is there any way to fix that? I need it so one click just counts as one click, not two per click. Here's the attachment to show you what I mean. |
Author: | Superskull85 [ Sun Nov 08, 2009 3:59 pm ] | ||
Post subject: | RE:Need help on Resturant Menu system | ||
After you determine if the button was pressed you could enter a loop and only exit when the button is not pressed:
|
Author: | B-Man 31 [ Sun Nov 08, 2009 4:00 pm ] | ||
Post subject: | Re: Need help on Resturant Menu system | ||
junkess @ Sun Nov 08, 2009 3:47 pm wrote: Alright B-man, I'm working on it so thanks. And the example you showed me up there ^ (for the Mouse.Where) ... If I click the button (rectangle), It adds more than just 2.50 because the computer adds more than one order due to my hold time during the time I press the mouse button and get my finger off the mouse button. Is there any way to fix that? I need it so one click just counts as one click, not two per click. Here's the attachment to show you what I mean.
so basically you can only click when click is false so it turns true when you push down but only become false again ones you let go of the button. |
Author: | junkess [ Sun Nov 08, 2009 4:02 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
This is, again, my latest menu program. This time, I just need to know how to get back to the main menu when I exit out of the Appetizer menu. |
Author: | B-Man 31 [ Sun Nov 08, 2009 4:09 pm ] | ||||
Post subject: | Re: Need help on Resturant Menu system | ||||
junkess @ Sun Nov 08, 2009 4:02 pm wrote: This is, again, my latest menu program. This time, I just need to know how to get back to the main menu when I exit out of the Appetizer menu.
so you need to go from one loop back into another right? like this
so for each menu you need a quit variable then include this:
This way it will exit the current loop and go back to the other one. |
Author: | junkess [ Sun Nov 08, 2009 4:19 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
Thanks B-man. That helped me out a lot. ![]() |
Author: | B-Man 31 [ Sun Nov 08, 2009 4:21 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
not a problem, i enjoy programming very much and I enjoy helping others discover the fun of programming. |
Author: | junkess [ Sun Nov 08, 2009 5:42 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
Okay, now I have two things that I need to know. 1. I need to know how the tax can be added when choosing the option number 4 on the main menu. 2. B-Man 31 wrote: You can also allow the user to order multiple of anything, ask the user how many of set dish, he/she would like to order. I would like to learn how to do exactly that. Thanks. Btw, I'll attach the latest version of my menu. |
Author: | B-Man 31 [ Sun Nov 08, 2009 5:55 pm ] | ||
Post subject: | Re: Need help on Resturant Menu system | ||
taxes you'll need 3 variables:
For Ordering multiple of each, its already been done since you added in the new code! you can order again and again! |
Author: | junkess [ Sun Nov 08, 2009 6:38 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
I'm having trouble again. I'm not sure if it's because I put your suggestion in the wrong place, but it does not work. The error description is "Variable has no value". Here's the attachment. |
Author: | B-Man 31 [ Sun Nov 08, 2009 6:42 pm ] |
Post subject: | RE:Need help on Resturant Menu system |
you should put that code right after your exit code. i cant write your whole program for you, just merely trying to show you small parts. Just try experimenting with it, where do you think it should go? |
Author: | junkess [ Sun Nov 08, 2009 7:02 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
![]() |
Author: | B-Man 31 [ Sun Nov 08, 2009 7:16 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
junkess @ Sun Nov 08, 2009 7:02 pm wrote: ![]() BTW, thtas because you have 2 total variables spelt diffrently and one has no value because you havent used it before, only declared it! ![]() |
Author: | junkess [ Sun Nov 08, 2009 8:24 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
Okay. I'm almost done. Just stumbled into this really weird error in my program. The computer doesn't sense it as an error, but when you enter into my food menu, you'll understand. If you have downloaded my other previous attachments to my program, you'll see that the newest attachment (this one right here on this post) that I changed the menu organization a bit. I did that because I got so frustrated with all the errors and weird glitches that keep occurring. Anyway, can someone help me fix this weird error? I get more frustrated when I try to fix it! ![]() ![]() Thanks. |
Author: | B-Man 31 [ Sun Nov 08, 2009 9:08 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
junkess @ Sun Nov 08, 2009 8:24 pm wrote: Okay. I'm almost done. Just stumbled into this really weird error in my program. The computer doesn't sense it as an error, but when you enter into my food menu, you'll understand. If you have downloaded my other previous attachments to my program, you'll see that the newest attachment (this one right here on this post) that I changed the menu organization a bit. I did that because I got so frustrated with all the errors and weird glitches that keep occurring. Anyway, can someone help me fix this weird error? I get more frustrated when I try to fix it! ![]() ![]() Thanks. |
Author: | junkess [ Sun Nov 08, 2009 10:09 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
![]() ![]() |
Author: | B-Man 31 [ Sun Nov 08, 2009 10:13 pm ] |
Post subject: | RE:Need help on Resturant Menu system |
lol, no problem man, glad to help! |
Author: | junkess [ Tue Nov 10, 2009 9:01 pm ] |
Post subject: | Re: Need help on Resturant Menu system |
Last request, I promise peoples. I can see the finish line in this program but I also see bumps and cracks along the road. In the following attachment, I need these errors fixed, plz!!! : 1. In the food menu selection, the only time the option, "How many do you want?" will appear is for nachos. I need that question to appear for all the food options. 2. In the receipt, the only item that shows you bought is nachos (that is, if you bought any.) I need all the items you bought on the list. 3. There HAS to be a more efficient way than the one I am currently using for the vars (variables). I've tried arrays but it doesn't seem to work...Maybe I'm just doing it wrong? These are the main problems I have been facing over the past few days. I am praying and hoping that someone will help me. These errors are so frustrating!! ![]() Anyway, Thanks so much to the person or people who help me. I very much appreciate it. |
Author: | B-Man 31 [ Wed Nov 11, 2009 7:43 am ] |
Post subject: | Re: Need help on Resturant Menu system |
Ill take a look at it in a bit, but about the arrays, because its user defined, you would need a flexible array, not a standard array, they are quite a bit harder to understand but it surely would do the trick ![]() |
Author: | junkess [ Wed Nov 11, 2009 8:10 am ] |
Post subject: | Re: Need help on Resturant Menu system |
Thanks. I know this sounds demanding and rude ![]() Take your time if you have to, and sorry for that. so thanks. ![]() |
Author: | apomb [ Wed Nov 11, 2009 8:36 am ] |
Post subject: | Re: Need help on Resturant Menu system |
junkess @ Wed Nov 11, 2009 8:10 am wrote: Thanks. I know this sounds demanding and rude
![]() Take your time if you have to, and sorry for that. so thanks. ![]() Hows about you delete that entire post? No one has to do this assignment except for you. |
Author: | junkess [ Wed Nov 11, 2009 11:16 am ] |
Post subject: | Re: Need help on Resturant Menu system |
Yeah, I figured. |