| Lone Lobo - Jun-04-2005 server time | ||
Or you could do it using GUI and do it that way...
Feel free to use that... If you need any help with any of the things I mentioned, just ask |
| Red Squirrel - May-27-2005 server time |
| Yeah much easier to have the list being ID and name, and you have to type in the ID, the ID would be from 1 to (number of items). So if you enter something not in that range, it gives an error. In most languages a letter is 0 so that covers that base as well. |
| wtd - May-27-2005 server time |
| No, but small minds seldom differ. |
| Streety - May-27-2005 server time |
| Great minds obviously think alike . . . |
| wtd - May-27-2005 server time |
| Yes. We've been following that line of reasoning elsewhere. |
| Streety - May-27-2005 server time |
| What happens when a user types in the tyre they want incorrectly? Surely it would be safer to give them a list from which they select? |
| syb - May-25-2005 server time |
| why not just use the "=" (a.k.a.: becomes) sign to change what ever varible you use for the tire picking into the number value. Then sub it into an equation that times the number of tire by the price. Then times it by 15% and last but not least add the answer to the 15% eguation to the answer of the price/amount of tires ex: tire band x amount requested = price price x 15% = tax price + tax = total price |
| wtd - May-24-2005 server time |
| Well, let me help you understand it. A function is basically a block of code to which we give a name. Why just write out the code each time when you can give it a meaningful name. PLus, this way, you make a change in one place, and it automatically takes effect everywhere. A function takes arguments (zero or more). These are values provided at run-time which can modify how the function works. The function then outputs a value as a result. What happens in between is that we say "if the brand is ABC, we get XYZ result". The "case" structure just makes this easier. So the result is that we can give the function the name of a brand of tires, and the function will spit out the price. |
| Da_Big_Ticket - May-24-2005 server time |
| Thanks for the help but im not at that level yet in turing and im getting very anxious about this program. I understand how to get the variable, like the tirebrand when someone imputs it, but i need to know how to get the program to tie a cost into each brand, so that later, I can multiply the number of tires needed but the brand, which has a cost tied into it. It is worded confusingly, i know, but if any of you can code this as simple as possible for me to understand i will pay you back somehow |
| wtd - May-24-2005 server time | ||||||
Place this logic into a function.
Then you might have a function to actually get the name of a brand:
Then you might write code like:
|
| Da_Big_Ticket - May-24-2005 server time |
| Basically I have to make a program that: 1) Gives a list of tires offered, and their prices (eg bridgestone-100, goodyear-130, michelin-150) 2) User types in the tire they want, the program will recognize the tire and its cost 3) User says how many tires theyd like, 4 gets them a discount of 20% on the tire itself. The price is calculated based on cost/tire ** #of tires 4) User selects yes/no as to wheter they want wheel alignment, wheel balancing, mounting, and disposal services. Each of these services has an individual price 5) the total price for everything is calculated and displayed, with tax being included. Thanks to who ever can help. My main problem is when the user says what tire they want, I need to code it so the price is recognized for that type of tire. Look here for an example, i need turing to recongnize that when a brand is imputed it recognizes a price for it Font.Draw ("Tire Makes (individual prices): Bridgestone: $100, Goodyear: $130, Michelin: $160.", 15, 320, questionfont, green) locate (7, 3) get brand if brand = "bridgestone" then price := 100 else if brand = "goodyear" then price := 130 else if brand = "Michelin" then price := 160 |