
-----------------------------------
nonamedude
Fri May 08, 2009 9:36 pm

Store odering program
-----------------------------------
What is it you are trying to achieve?



What is the problem you are having?
 


Describe what you have tried to solve this problem



Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)








Please specify what version of Turing you are using


-----------------------------------
Tony
Fri May 08, 2009 9:40 pm

RE:Store odering program
-----------------------------------
start with the Turing Walkthrough and see how far you get into it.

-----------------------------------
nonamedude
Fri May 08, 2009 9:44 pm

Re: Store odering program
-----------------------------------
Ok i figured out how to import using google, i know the basics like

counters , arrays , procedures, loops etc.. but i just got really stuck at the display part, i can make it display the product name but not the price...

-----------------------------------
Tony
Fri May 08, 2009 10:36 pm

RE:Store odering program
-----------------------------------
how are you displaying the product name? And how is the price different from the name, in a way that doesn't let it be displayed by the same method?

-----------------------------------
nonamedude
Sat May 09, 2009 9:10 am

Re: Store odering program
-----------------------------------
ok the price will be real numbers and the name is string, i guees u know that, ok here an idea of what i am trying to achieve

                                  Product Name                                                                   Price
Image                           Product 1                                                                       10.00
    ''                               Product 2                                                                       12.50
    ''                               Product 3                                                                       14.00
    ''                               Product 4                                                                       15.25
    ''                               Product 5                                                                       16.25

How many poducts would u like to buy?
2
What product would u like 2 buy?1
What product would u like 2 buy?2

Display bill

                                     Product 1                                                                       10.00
                                     Product 2                                                                       12.50

if u still dont get what i am trying to achive i'll post my assignment question.

-----------------------------------
tjmoore1993
Sat May 09, 2009 10:16 am

RE:Store odering program
-----------------------------------
You shouldn't approach the idea like that for the fact it would be a waste of a program. When programming try basing it off a real life situation. Your program is basically a grocery store... Right?

When you go to buy food from a grocery store the cashier will never ask you how many products would you like to buy. That would be totally messed up, instead you look for the things you need and add them into your shopping cart.

Why not have some sort of shopping cart system...

Example:

var Selection : int
var Picture : array 1 .. 3 of int
var Information : array 1 .. 3, 1 .. 2 of real
var Height : int
var Cost : real := 0
var Add : char

Picture (1) := Pic.FileNew ("C:\\Example.bmp")
Information (1, 1) := 5.99
Picture (2) := Pic.FileNew ("C:\\Example.bmp")
Information (2, 1) := 6.94
Picture (3) := Pic.FileNew ("C:\\Example.bmp")
Information (3, 1) := 7.25
loop
    loop
        cls
        put "Total Cost : ", Cost
        put "1 - Dog food"
        put "2 - Carrots"
        put "3 - Candy"
        get Selection
        if Selection >= 4 or Selection 