
-----------------------------------
computerscienceishard
Sat Nov 07, 2009 5:42 pm

Help!!! Asap!!!
-----------------------------------
so my computer technology teacher want me to write a program that "prints out a receipt" using the program Turing 
my friend and I worked on it for a while 
but everytime we tried to add to the program, it gets even more confusing 
so basically, we have to make a menu on the computer screen, just like the ones you see at restaurants 
then it asks the user for the dishes that they want 
then Turing should show something like:
for example
cheese                 1.20
bread                   2.00

Total: $3.20
tax. 
grand total...

something along the lines of that 
I just need a solution for this problem, 
so I don't need a program or anything 
because I want to try to accomplish this project without any help.
well, 
i guess a bit of help becuase my teacher hasn't been at class for a while 
so there isn't really anyone i can ask!

THANKS!!!!
waiting for the replies!!![/img]

-----------------------------------
Superskull85
Sat Nov 07, 2009 8:51 pm

RE:Help!!! Asap!!!
-----------------------------------
How much of the Turing language do you?

To output messages use the put statement, and to get input from the use the get statement.

An example of put:

put "cheese 1.20"
An example of get:

var UserInput : string
get UserInput
If you post some code we can help solve a specific problem, but we are not going to do the assignment for you.

Also, this post should of been posted in the Turing section instead of General Programming.

-----------------------------------
computerscienceishard
Sun Nov 08, 2009 4:49 pm

Re: Help!!! Asap!!!
-----------------------------------
thanks for replying !!!    :D 
I know how to get the dish and everything. but my teacher told us to use running total to get the receipt. 
i have a simplified version of my program, but I'm stuck, and I can't get the receipt part. 
I'm not sure if my program is correct or not, so if it's wrong, you can just tell me. 


put "welcome" 
  var dish : array 1 .. 2 of string
        dish (1) := "soup of the Day "
        dish (2) := "Garden Salad  "
        var price: array 1..2 of real 
 price (1):= 3.65
        price (2):= 2.55
var n: int 
put "How many orders?"
get n
var list: array 1..n of real 
put skip 
put "Please enter ", n," dish(es)"
for i: 1..n
get list (i)
end for 
put skip 
put "Your orders are:"
put skip 
for i: 1..n 
put list (i): 5..
end for 
put skip 
put "Processing Receipt..." 



*The next part is the receipt part, and I'm stuck*
so supposedly. 
it's supposed to say 

"WELCOME"  (for example) 

1  soup of the day           @ 3.65

subtotal: 3.65
tax: ...
tip:...
grand total: ...

this is our first part. 
then our teacher wants us to calculate all the tips given to the restaurant in another section of the program. 
also the same with taxes. 
and then, the grand total of everything added up together so the restaurant can see how much they earned that day.
and lastly, we have to ask the user if they want to exit the program.

-----------------------------------
ecookman
Sun Nov 08, 2009 8:37 pm

RE:Help!!! Asap!!!
-----------------------------------
you have the item equal a numerical value

you want the program to print the variable that keeps track of the cost for the subtotal. As for tax, you want to make a variable that is equal to the variable for the subtotal and multiply it by what the tax is (tax := subtotal * [tax about]) ( I have no clue what it is now a quick Google search will fix that). THEN for the total add the tax and the subtotal variable and print it to the screen.
