Question: Project 2 : An Application Employing Synchronized / Cooperating Multiple Threads In Java Using Locks A Banking Simulator Points: 1 0 0 points Due Date:

Project 2: An Application Employing Synchronized/Cooperating Multiple
Threads In Java Using Locks A Banking Simulator
Points: 100 points
Due Date: Sunday September 22,2024 by 11:59 pm (WebCourses time)
Objectives: To develop an application which requires cooperating, synchronized
multiple threads of execution.
Project Overview: In this project you will simulate the deposits and withdrawals
made to fictitious bank accounts (Ill let you use my real bank accounts if you
promise to make only deposits! J). In this case the deposits and withdrawals will
be made by user agents (synchronized threads). Synchronization is required for
two reasons (1) mutual exclusion (updates cannot be lost) and (2) because a
withdrawal cannot occur if the amount of the withdrawal request is greater than
the current balance in the account. This means that access to the account (the
shared object) must be synchronized. This application requires cooperation and
communication amongst the various agents (cooperating synchronized threads).
(In other words, this problem is similar to the producer/consumer problem where
there is more than one producer and more than one consumer process active
simultaneously.) If a withdrawal agent attempts to withdraw an amount greater
than the current balance in the account then it must block itself and wait until a
depositing agent has added money to the account before it can try again. As we
covered in the lecture notes, this will require that the depositing agents signal all
waiting withdrawing agents whenever a deposit is completed.
Agents: There are five different types of agents in this simulation as follows:
1. Depositor Agents: These agents add(+) money to a bank account. To keep
things relatively simple, assume that deposits are made in random
amounts ranging from $1 to $600(whole dollars only), Depositor agents
never block.
2. Withdrawal Agents: These agents remove(-) money from a bank account.
Withdrawal agents will make withdrawals in random amounts ranging from
$1 to $99(again, whole dollars only). Withdrawal agents block if the
balance of the account in question is less than the amount the withdrawal
CNT 4714 Project 2 Fall 2024

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!