Thread: Programming Puzzle 13 - Paycheck Amount?

1. Programming Puzzle 13 - Paycheck Amount?

Mr. Karbunkle went to the bank to cash his weekly paycheck. In handing over the money, the cashier, by mistake, gave him dollars for cents and cents for dollars.

He pocketed the money without examining it and spent a nickel on candy for his little boy. He then discovered the error and found he possessed exactly twice the amount of the check.

If he had no money in his pocket before cashing the check, what was the exact amount of the check? One clue: Mr. Karbunkle earns less than \$50 a week.

(Courtesy: Creative Computing Magazine)

Instructions:

Write an xbasic script that solves the puzzle and displays the answer in a message box on screen.

2. Re: Programming Puzzle 13 - Paycheck Amount?

Hrm.. Sounds like I might want to start banking at Mr. Karbunkle's bank.

3. Re: Programming Puzzle 13 - Paycheck Amount?

I took a different approach using brute force to test all the possible amounts that might have been given to Karbunkle by the cashier.

4. Re: Programming Puzzle 13 - Paycheck Amount?

Here is my attempt for puz 13.

puz 13.txt

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•