program
Author |
Message |
Mrs A
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
skatelhs
|
Posted: 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!
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 |
|
|
|
|
![](images/spacer.gif) |
skatelhs
|
Posted: Mon Jun 16, 2003 12:12 pm Post subject: (No subject) |
|
|
MRS VAGEON IS A STUPID WHORE, AS IVE SAID BEFORE |
|
|
|
|
![](images/spacer.gif) |
Asok
![](http://www.battle.net/war3/images/neutral/units/animations/pandarenbrewmaster.gif)
|
Posted: Mon Jun 16, 2003 1:32 pm Post subject: (No subject) |
|
|
locked. You know why. |
|
|
|
|
![](images/spacer.gif) |
|
|