| | if (ItemNumber == 1 && Pepsi > 0)
{
Pepsi--;
log.log ("Thank You For Purchasing a Pepsi!");
transaction.newComplete().send();
}
else
{
log.log ("Sorry, Item is currently out of stock.");
cancle.newCancle(ItemNumber).send();
}
if (ItemNumber == 2 && Fizzle > 0)
{
Fizzle--;
log.log ("Thank You For Purchasing a Fizzle!");
transaction.newComplete().send();
}
else
{
log.log ("Sorry, Item is currently out of stock.");
cancle.newCancle(ItemNumber).send();
}
if (ItemNumber == 3 && Squishy > 0)
{
Squishy--;
log.log ("Thank You For Purchasing a Squishy!");
transaction.newComplete().send();
}
else
{
log.log ("Sorry, Item is currently out of stock.");
cancle.newCancle(ItemNumber).send();
}
if (ItemNumber == 4 && Yohoo > 0)
{
Yohoo--;
log.log ("Thank You For Purchasing a Yohoo!");
transaction.newComplete().send();
}
else
{
log.log ("Sorry, Item is currently out of stock.");
cancle.newCancle(ItemNumber).send();
} |