Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Pizza Shop Program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
imraan16




PostPosted: Sun Jan 22, 2012 4:35 pm   Post subject: Pizza Shop Program

What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>


What is the problem you are having?
What can i do to make my program better

Describe what you have tried to solve this problem
<Answer Here>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:

var toppings, response, name, address : string
var pizza, drink, total_pizza, sub_total, total, number, tax, bread, pizza_price : real
var number_pizza, number_toppings, number_drinks, order, table_number, fileno, size : int
locate (3,30)
put "WELCOME TO IMRAAN'S PIZZERIA"
locate (4,28)
put "Where Our Pizza is Freshly Made"
drawfilloval (340, 200, 100, 100, 43)
drawfilloval (341, 200, 85, 85, brightred)
drawfilloval (340, 200, 70, 70, yellow)
drawfilloval (340, 220, 10, 10, red)
drawfilloval (310, 200, 10, 10, red)
drawfilloval (350, 180, 10, 10, red)
drawfilloval (380, 200, 10, 10, red)
drawfilloval (320, 160, 10, 10, red)
drawfilloval (320, 250, 10, 10, red)
drawfilloval (370, 250, 10, 10, red)
drawfilloval (370, 155, 10, 10, red)
procedure key
    var ch : string (1)
    getch (ch)
end key

locate(22,26)
put " Press any key to proceed to order"
key
for a : 1 .. maxx
    delay (1)
    drawfillbox (0, 8, a, 0, black)
end for
cls
put "WELCOME TO IMRAAN'S PIZZERIA"
put ""
put "Items" : 30, "Cost"
put "Small Pizza" : 30, "$7.50"
put "-additional items $0.30"
put "Medium Pizza" : 30, "$10.50"
put "-additional items $0.50"
put "Large Pizza" : 30, "12.50"
put "-additional items $0.65"
put "Extra Large Pizza" : 30, "14.00"
put "-additional items $0.75"
put "Garlic Bread" : 11
put "-with cheese $3.00" : 11
put "Coffee"
put "Tea"
put "Pop"
put "-small $1.10"
put "-large $1.80"
put "-2L $2.25"
put ""

locate (20, 25)
procedure getKey
    var ch : string (1)
    getch (ch)
end getKey


put " Press any key to proceed to order"
getKey
for a : 1 .. maxx
    delay (1)
    drawfillbox (0, 8, a, 0, black)
end for
cls

open : fileno, "C:/Menu/order.txt", put

put "Choose:[1]eat-in , [2]take-out, or [3]delivery"
get order
if order = 1 then
    put "What is your table number"
    get table_number
    put : fileno, table_number
    put ""
elsif order = 2 then
    put "Please enter in you name"
    get name
    put : fileno, name
    put "Please enter in your phone number"
    get number
    put : fileno, number
elsif order = 3 then
    put "Please enter in you name"
    get name
    put : fileno, name
    put "Please enter in your phone number"
    get number
    put : fileno, number
    put "Please enter in your address"
    get address
    put : fileno, address
end if

put "Proceed to food order"
for a : 1 .. maxx
    delay (1)
    drawfillbox (0, 8, a, 0, black)
end for
cls

put "Would you like any pizza Y/N"
put "Press Y for Yes or N for No"
get response
if response = "Y" or response = "y" then
    put "Proceed to pizza order"

elsif response = "N" or response = "n" then
    put "No pizza chosen"
    number_pizza := 0
end if
if response = "Y" or response = "y" then
    for a : 1 .. maxx
        delay (1)
        drawfillbox (0, 8, a, 0, black)
    end for
    cls
    put "How many pizza would you like"
    get number_pizza
    put " Place your pizza order here"
    put "Press 1 for a small pizza"
    put "Press 2 for a medium pizza"
    put "Press 3 for a large pizza"
    put "Press 4 for a extra large pizza"
    for b : 1 .. number_pizza
        get size
        put : fileno, size, number_pizza
    end for
    if size = 1 then
        pizza := 7.50
        pizza_price := number_pizza * pizza
    elsif size = 2 then
        pizza := 10.50
        pizza_price := number_pizza * pizza
    elsif size = 3 then
        pizza := 12.50
        pizza_price := number_pizza * pizza
    elsif size = 4 then
        pizza := 14.00
        pizza_price := number_pizza * pizza
    end if
    put "Would you like any topings on your pizza Y/N"
    put "Press Y for Yes or N for No"
    get response
    if response = "Y" or response = "y" then
        put "Proceed to toppings"
    elsif response = "N" or response = "n" then
        put "No toppings chosen"
        number_toppings := 0
    end if

    if response = "Y" or response = "y" and pizza > 0 then
    for a : 1 .. maxx
    delay (1)
    drawfillbox (0, 8, a, 0, black)
end for
cls
        put "How many toppings would you like"
        get number_toppings
        put "List the toppings you would like"
        put "additional toppings $0.50"
        put "pepperoni, onion, green pepper, mushroom, hotpepper, bacon" ..
        put "beef, anchovies, x-cheese, olives, ham, pineapple."
        for b : 1 .. number_toppings
            get toppings : *
            put : fileno, toppings, number_toppings
        end for

    end if
end if
put "Proceed to garlic bread order"
for a : 1 .. maxx
    delay (1)
    drawfillbox (0, 8, a, 0, black)
end for
cls
put "Would you like a garlic bread Y/N"
get response
if response = "Y" or response = "y" then
    put "Proceed to choice of garlic bread"
elsif response = "N" or response = "n" then
    put "No garlic bread chosen"
    bread := 0
end if
if response = "Y" or response = "y" then
    put "Press 1 for gralic bread"
    put "Press 2 for garlic bread with cheese"
    get bread
end if
if bread = 1 then
    bread := 2.50
    put "Garlic Bread $2.50"
elsif bread = 2 then
    bread := 3.00
    put "Garlic Bread with cheese"
end if
put : fileno, bread

put "Proceed to drink order"
for a : 1 .. maxx
    delay (1)
    drawfillbox (0, 8, a, 0, black)
end for
cls

put "Would you like anything to drink Y/N"
get response
if response = "Y" or response = "y" then
    put "Proceed to drinks"
elsif response = "N" or response = "n" then
    put "No drinks chosen"
    drink := 0
end if
if response = "Y" or response = "y" then
    put "Here are the list of drinks we offer"
    put "Press 1 for coffee"
    put "Press 2 for tea "
    put "Press 3 for small pop"
    put "Press 4 for large pop"
    put "Press 5 for 2L pop"
    get drink
end if
if drink = 1 then
    drink := 1.00
    put "Coffee = $1.00"
elsif drink = 2 then
    drink := 1.00
    put "Tea = $1.00"
elsif drink = 3 then
    drink := 1.10
    put "Small Pop = $1.10"
elsif drink = 4 then
    drink := 1.80
    put "Large Pop = $1.80"
elsif drink = 5 then
    drink := 2.25
    put "2L = 2.25"
end if
put : fileno, drink
close : fileno
put "Proceed to check out"
for a : 1 .. maxx
    delay (1)
    drawfillbox (0, 8, a, 0, black)
end for
cls

open : fileno, "C:/Menu/order.txt", get
sub_total := number_toppings * 0.50 + pizza_price + drink
tax := sub_total * 0.13
total := sub_total + tax
if order = 1 then
    put "RECEIPT"
    put "********************************"
    put ""
    put "Imraan's Pizzeria"
    put ""
    put "Manager: Imraan Mohamoud"
    put ""
    put "Table Numuber: ", table_number
    put "Eat-In[1], Take-Out[2], Delivery[3]: ", order
    put "Tax: $", tax : 0 : 2
    put "Sub-Total: $", sub_total : 0 : 2
    put "Total: $", total : 0 : 2
elsif order = 2 then
    put "RECEIPT"
    put "********************************"
    put ""
    put "Imraan's Pizzeria"
    put ""
    put "Manager: Imraan Mohamoud"
    put ""
    put "Name: ", name
    put "Phone Number: ", number
    put "Eat-In[1], Take-Out[2], Delivery[3]: ", order
    put "Tax: $", tax : 0 : 2
    put "Sub-Total: $", sub_total : 0 : 2
    put "Total: $", total : 0 : 2
elsif order = 3 then
    put "RECEIPT"
    put "********************************"
    put ""
    put "Imraan's Pizzeria"
    put ""
    put "Manager: Imraan Mohamoud"
    put ""
    put "Name: ", name
    put "Phone Number: ", number
    put "Address : ", address
    put "Eat-In[1], Take-Out[2], Delivery[3]: ", order
    put "Tax: $", tax : 0 : 2
    put "Sub-Total: $", sub_total : 0 : 2
    put "Total: $", total : 0 : 2
end if
close : fileno




Please specify what version of Turing you are using
<Answer Here>
Sponsor
Sponsor
Sponsor
sponsor
Alex C.




PostPosted: Sun Jan 22, 2012 5:10 pm   Post subject: RE:Pizza Shop Program

what are you not happy about? Confused
RandomLetters




PostPosted: Sun Jan 22, 2012 5:24 pm   Post subject: RE:Pizza Shop Program

Do you go to UHS?
Alex C.




PostPosted: Sun Jan 22, 2012 5:40 pm   Post subject: RE:Pizza Shop Program

...no. why Confused
Velocity




PostPosted: Wed Jan 25, 2012 12:18 am   Post subject: RE:Pizza Shop Program

alex can u stop posting such waste posts, if u just want to look flashy with posts dont do it on this forums, all ur posts have no relevance to the topic. And aree like 5 words each.

--------------------

Try using more procedures, u have alot of repeated lines of code.
Look up font.draw
Oh and your ur getch procedure u dont need to state it more than once you can put ''key'' anywhere you want to call it. Make sure you know what procedures are first.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: