Looking for a shot of sugar or caffeine to get you through the afternoon? It may soon be easier than ever to pick up a snacktime energy boost.

In three cities, Cadbury Schweppes (NYSE:CSG) and MasterCard (NYSE:MA) have been testing to see if people will spend more at vending machines if they can pay with plastic. The answer, according to this Associated Press report, seems to be yes. In some machines installed in January, sales have increased 5% to 35%.

Cadbury will be evaluating the tests after a few months before deciding whether to put these new-fangled vending machines in additional cities. MasterCard has also been working with Coca-Cola (NYSE:KO) to place vending machines that accept plastic around Philadelphia.

This could end up being great news for anyone invested in soft drink, chip, and candy bar makers, since such companies could start seeing vending sales take off if these machines become a widespread phenomenon.

For hungry office workers and others digging into their pockets and purses for loose change, the switch might be a losing proposition. You can't give in to temptation when you can only dig up one grimy quarter and your favorite candy bar costs $0.75. If you can pull out the credit card or debit card, however, you can get one to eat now and one to have later.

Vending machines, along with expensive lattes and fast food, get a bad rap in personal finance columns. They're often blamed for undoing all the good intentions of people trying to save more, get out of debt, or stick to a budget.

While you probably can't blame sugary, salty, fatty treats for all of your financial woes, there's some truth to the well-worn maxim that if you watch the pennies, the dollars take care of themselves.

Let's say you stop at the office vending machine every day at 3:30 p.m. for a bag of chips and a soft drink at a cost of $1.75. In a week, you'll have spent $8.75. Keep up the habit for a year and you'll have spent $455!

Did you really get $455 worth of enjoyment out of pretzels, potato chips, and colas? Some days, you'll probably swear the answer is yes! But, in retrospect, you can probably see that there are better ways to spend nearly $500. Heck, you could buy $500 worth of stock in MasterCard, Coca-Cola, or Cadbury Schweppes.

The new vending machines illustrate why credit cards and small expenses pose a problem for many people. First, when you're tired and hungry, you'll pump whatever money you can find into the machine to get that rush of sugar. If there's no money in your pocket, you'll have to step away from the machine or beg your friends to lend you some money.

Cash works as a backstop against impulse spending. If you have no cash, you can't spend it. That's one reason why converting to an all-cash diet helps many people get out of debt and get a handle on their expenses.

Also, small expenses can add up fast. It's easy for money to drain out of your fingers a couple of quarters at a time. Keep track of all your incidental spending for a month and you might be surprised at how much it adds up.

Put those expenses on a credit card, and it will probably be even harder to notice the dollar bills disappearing from your wallet. But you'll definitely notice when your credit card bill comes.

Related Foolishness:

Fool contributor Mary Dalrymple has been known to hang out by the vending machine occasionally. She does not own stock in any company mentioned in this article. She welcomes your feedback. Coke is a Stock Advisor selection, while Mastercard is an Inside Value pick. The Motley Fool has a disclosure policy.