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

Username:   Password: 
 RegisterRegister   
 class porj. im having trouble with
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
hheellpp




PostPosted: Wed May 25, 2005 8:21 am   Post subject: class porj. im having trouble with

Cafeteria Selections Program - This program would permit studentsto choose their lunch purchases from a menu in the cafeteria. (a test fite {notepad} that is called up, with lines sumin like this: Burger 2.33) It calculates the tax{im in ontario... 7%tax on GST and 8% PST} on taxable items (candy, pop), and presents the user with a total. Asks them how they will be able to pay.... just for the user to enter an amount of money so that u can calculate the amout of change. The program accepts a tendered amount and computes and outputs change downto the actual coins and bills involved. An added inventory component could keep a running total of individual items purchased.

and when the program ends... it would be nice if it looked sumin like a bill u get in the store...
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Wed May 25, 2005 8:46 am   Post subject: (No subject)

Ok...thanks for the description.

Here's the next couple of things you should do:
- create some pseudo-code
- code as much of it as you can
- comment your code
- if you encounter any problems, post up the section of the code that you're having trouble with, including a description of what it's supposed to do, and possibly what it's doing wrong. If you're nice, you'll also ensure that the code runs (i.e., if you cut out a section to show us, you'll make sure all vars are declared etc).
Malazan




PostPosted: Fri Jun 03, 2005 9:32 am   Post subject: (No subject)

I actually did this program in class. Here you enter the food, then it calculates the total cost + PST + GST. Also does tip too. If you want a list to make, do a case construct.
code:

var food1, food2, food3, food4, food5 : string
var cost1, cost2, cost3, cost4, cost5, totalcost, totalcost2, tip : real
put "Please enter the first item: " ..
get food1 : *
put "Please enter the price of the first item: $" ..
get cost1
cls
put "Please enter the second item: " ..
get food2 : *
put "Please enter the price of the second item: $" ..
get cost2
cls
put "Please enter the third item: " ..
get food3 : *
put "Please enter the price of the third item: $" ..
get cost3
cls
put "Please enter the fourth item: " ..
get food4 : *
put "Please enter the price of the fourth item: $" ..
get cost4
cls
put "Please enter the fifth item: " ..
get food5 : *
put "Please enter the price of the fifth item: $" ..
get cost5
cls
totalcost := cost1 + cost2 + cost3 + cost4 + cost5
totalcost2 := totalcost * 0.15 + totalcost
tip := totalcost2 * 0.15
put "The total price of all the items is $", totalcost2 : 0 : 2, " . "
put "15% tip for the waiter/waitress is $", tip : 0 : 2, ". "
put "The total is $", tip + totalcost2 : 0 : 2
put "Thanks for ordering from our restaurant!"
delay (4000)
cls
colorback (black)
cls
color (white)
locate (10, 38)
put "Thank You!"

There you go Wink
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  [ 3 Posts ]
Jump to:   


Style:  
Search: