Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

could anyone please answer this question ASAP The goal of this project is to design and develop C++ code and algorithms to simulate a queue

could anyone please answer this question ASAP The goal of this project is to design and develop C++ code and algorithms to simulate a queue in a bank, serviced by several tellers. A second goal is to e?ectively employ object-oriented design techniques, through appropriate use of classes, data structures and Standard Template Libraries (STLs). 1.1 Problem Speci?cations

The bank has N tellers servicing the customers. As an example, you may choose N = 4.

Each teller has two states, free or busy. The program loops through discrete time steps t = 1,2,...Tstop, where Tstop is an input parameter.

At each time step, either 0, 1 or 2 persons arrive at the bank, and get added to the back of the queue. This information can be read from an input data ?le, as described in

1.3. The customers at front of the queue get assigned a free teller. If there are two free tellers at a given time step, then two customers pop o? the queue in that time step.

Each customer conducts either 1, 2 or 3 tasks, as speci?ed below: Deposit a check Withdraw some cash Print recent transactions, from a list.

A teller takes 1 time step to complete a task. So, if a customer wants to deposit a check, and withdraw some cash, the total service time is 2 time steps. The number of customers in the queue gets updated at each time step. Each arriving customer has an ID, account number, account balance and a list of recent transactions, as its data members.

The queue can have a max of Nmax customers. 1.2 Class Design and STLs You must make appropriate use of classes and class objects, class data members, class methods, constructors and destructors to implement your code. You must also make appropriate use of STL containers, such as deque and vector. Here are some suggested classes and their data members:

Customer class with ID, account number, account balance and a list of recent transactions. For customer ID, use C1,C2,C3 .... This will make it easier to generate and track test input and output.

An example list of recent transactions maybe:

Description Amount

Food Mart ?27

Carnival Cinemas ?13

Deposit +200

Chai Shop -9

For this inpu data need to get from text file

Teller class, with ID and status.

1.3 Input Data The input data consists of customer arrivals, at time steps t = 1,2,...TStop. 1.4 Program Output Generate appropriate output for a given input test data, which displays the information, that is, customers being added to the queue, customers being serviced and the teller servicing the customer, for each time step, for about 15 consecutive time steps.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago