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

Username:   Password: 
 RegisterRegister   
 program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mrs A




PostPosted: Mon Jun 16, 2003 12:06 pm   Post subject: program

Does anyone know how to run a rpogram that gets a program to enter the amt of egg's/onions they want. then with the price being 3.5 and 2.00 ...then output the total? im alil confused on how i get the total and the prices to collaborate
Sponsor
Sponsor
Sponsor
sponsor
skatelhs




PostPosted: Mon Jun 16, 2003 12:11 pm   Post subject: heehee mrs. a

%Eggs and Onions!
%By Adam Skelly
%June 16th, 2nd last day of school! Smile
var eggs : int
var onions : int
var choice : string
eggs := 0 %shows that you start out having bought 0 dozen eggs
onions := 0%shows that you start out having bought 0 bags of onions
loop
put "What would you like to buy? A dozen eggs, or a bag of onions? Type leave to stop."
get choice %Gets the choice from customer
if choice = "eggs" then
eggs := eggs + 1 %If eggs are chosen, var eggs becomes = to eggs plus one
put "You have bought ", eggs, " dozen eggs, which comes to $", eggs * 2
put "You have bought ", onions, " bags of onions, which comes to $", onions * 3.5
put "Your total is $", (eggs * 2 + onions * 3.50) %Displays how much it costs
put " " %gives a space
else
if choice = "onions" then
onions := onions + 1 %If onions are chosen, onions becomes = to onions plus 1
else
quit %If anything other than onions or eggs are chosen, the program quits

end if
theres your answer, mrs a... lol
skatelhs




PostPosted: Mon Jun 16, 2003 12:12 pm   Post subject: (No subject)

MRS VAGEON IS A STUPID WHORE, AS IVE SAID BEFORE
Asok




PostPosted: Mon Jun 16, 2003 1:32 pm   Post subject: (No subject)

locked. You know why.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: