I need very basic turing help
Author |
Message |
deadskull56
|
Posted: Fri Mar 25, 2011 4:57 pm Post subject: I need very basic turing help |
|
|
I have a project: the situation is as follows: A resteraunt would like to have a computer system too create and display the bill/receipt and to keep a track of the total sales, tips and taxes. They need to have a software that they can use on their computer.
Write a progra, that displays options:
A. Run Food Menu
B. Sub total of all sales
C. Total of all tips
D. Total of all taxes
E. Grand total
What I have so far:
var order : string
var total : string
var yes : string
var no : string
var choice : string
var A : string
var B : string
var C : string
var D : string
var E : string
var F : string
var a : real
var b : real
var c : real
var d : real
var e : real
var f : real
var g : real
var h : real
var i : real
var j : real
var total1:int
loop
put "Options"
put "a. Food Menu"
put "b. Subtotal of all Sales"
put "c. Total of all Tips"
put "d. Total of all taxes"
put "e. Grand Total"
put "f. Exit"
get choice
if choice = "a" then
cls
locate (4, 35)
put "Menu"
locate (5, 20)
put "a. Philly Cheesesteak............. $10.95"
locate (6, 20)
put "b. Meat Omelet.................... $10.95"
locate (7, 20)
put "c. Ribeye......................... $12.95"
locate (8, 20)
put "d. Hamburger...................... $8.95"
locate (9, 20)
put "e. Caeser Salad................... $4.95"
locate (10, 20)
put "f. Sundae......................... $5.95"
locate (11, 20)
put "g. Pie............................ $3.95"
locate (12, 20)
put "h. Juice.......................... $1.25"
locate (13, 20)
put "i. Coffee......................... $1.50"
locate (14, 20)
put "j. Tea............................ $1.25"
locate (15, 20)
put "Press 11 to return to main options"
locate (16, 20)
put "What would you like to order?"
loop
get choice
a := 10.95
b := 10.95
c := 12.95
d := 8.95
e := 4.95
f := 5.95
g := 3.95
h := 1.25
i := 1.50
j := 1.25
put "Would you like anything else? (y/n)"
get choice
if choice = "y" then
elsif choice = "n" then
cls
exit
end if
end loop
end if
end loop
AFTER GETTING THAT how do i get my program to store the selected options and add them to get a subtotal for option B. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Zren

|
Posted: Fri Mar 25, 2011 5:53 pm Post subject: RE:I need very basic turing help |
|
|
For the future when you post code.
Turing: |
put "Power Courage Wisdom"
|
code: |
[syntax="turing"]
put "Power Courage Wisdom"
[/syntax]
|
When you start ordering, your total is 0. When you buy something, it's added to the total is it not? |
|
|
|
|
 |
Raknarg

|
Posted: Wed Mar 30, 2011 3:04 pm Post subject: RE:I need very basic turing help |
|
|
First off - this should be in "help", for future reference.
second - state your variables all together, it shortens the code:
var A, B, C, D, E, F : string
and so on.
third - why is your total a string? |
|
|
|
|
 |
Tony

|
|
|
|
 |
|
|