Question Get Answer

Pete has two accounts with XBank, a savings account and a checking

account. The fees on checking account are 10% of the balance, while the interest on the savings account is 10%. Pete will be travelling for a while and won't need either of the accounts, but wants to keep a set amount on the checking account at all time for a case of emergency. At the beginning of his trip he has a deposit of $1000 on the checking account, and a deposit of $1000 on the savings account. To balance the accounts, Pete scheduled a regular transfer of $100 from the savings to the checking account. Pete reasons that the 10% interest on the savings account will cover exactly the fee. Upon his return, Pete finds much to his surprise that his accounts fall short of the expected $2000. He calls customer service of XBank. The customer representative tells him that they can't find any problem with their banking software; they tested it a few times with the amounts Pete provided, and each time the final combined balance was $2000. The banking software completed three tasks, each by a separate thread. The first thread withdraws the fee from the checking account, the second adds the interest to the savings account, and the final thread transfers $100 from the savings to checking account. Question 1 Open the project banking, clean and build it, and run it a few times. Can you reproduce Pete's problem? Analyze and describe the problem, and how to solve it. Use the debugger if necessary. Question 2 Use semaphores to synchronize the above banking problem. Implement in the program files provided to you.

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 Computer Science tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes