Local Money Bank is an established, favorite bank in our community, serving individual consumers withspeed, great customer service and efficiency. Currently, in person services have curtailed due...

1 answer below »

Local Money Bank is an established, favorite bank in our community, serving individual consumers withspeed, great customer service and efficiency. Currently, in person services have curtailed due toexternal environmental and health issues. Customers are still in need of these services on a virtualbasis. Providing a virtual teller experience with the same basic financial transactions each customerneeds, is pertinent to continuing Local Money Bank’s excellent service record and continued business inperson or virtually as needed.




To create this virtual experience, you are required to simulate using a C++11 program (in Dev-C++ 5.11) - using the following parameters and rules:





  • Handle customers as soon as possible coming in at random times during open service hours only:


    • Open service hours will be between 10 am and 1 pm.






  • Each customer will have a random amount of service time needed during their random requested services





  • All of these are required to be randomly generated, collected and stored for current (below) reporting requirements (and future reporting requirements):


    • Customer Last name,

    • Customer arrival times


      • (between 10 am and 1pm only)


    • Customer account status (opened or null)

    • Customer account balance (only positive - $0 or greater)

    • Transaction type (1 of the 4)


      • Open an Account


        • ( (chosen from those with an acct status of 'NULL'

        • Since they do not have one, (null)


          • (check first by last name for each randomly genrated customer that 'attempts to open an account')


        • Opening an account will also randomly generate a deposit of null ($0) to any other positive amount and added to the previous ($0) balance


      • Close account


        • (only chosen from among those that have an accoutn status of 'OPEN'


          • (only if one is open check first)


        • Closing an account will 'withdraw; current balance to 0


      • Withdraw money


        • (withdrawal amount randomly generated up to the current account balance


          • (account must remain positive)



      • Deposit money


        • (amount randomly generated and added to the previous balance total)


      • Transaction service time it takes








Handling of customers:



  • Each customer will require random amount of service time for each transaction


    • Customers will be handled as soon as a teller is available based on the below parameters


  • You may have 1-3 tellers based on the # of customers


    • Once you have more than 4 customers waiting you need to get the 2ndteller

    • Once you have more than 8 customers waiting you need to get the 3rdteller

    • Once the line size gets smaller, you should remove the tellers in opposite order of their addition (the last one joining should be the first one leaving) (






  • At the end of the day, you need to run the following reports:


    • A list of customers coming


      • along with the type of transactions they requested.

      • Amount of money involved

      • Time of arrival


    • This report should be sorted by:


      • Last name of the customer



  • Additonal reported items:


• Average waiting time per customer (Start is arrival time, end of the wait is when service begins (wait duration)), teller starts 'random service time between 1-10 minutes of random transaction tupe


• Average number of customers waiting




overall this should be completed using key concepts where necessary, possible

Answered 2 days AfterOct 28, 2021

Answer To: Local Money Bank is an established, favorite bank in our community, serving individual consumers...

Vaibhav answered on Oct 30 2021
138 Votes
LocalMoneyBank.cpp
#include
#include
#include
#include
#include
#include
using namespace std;
/**
* @brief Represents a customer that arrives at the bank.
*
*/
class Customer {
public:
// the last name of the customer.
string lastName;
// the arrival time of the customer.
string arrivalTime;
// status of the account. (true if open and false if not open)
bool accountStatus;
// denotes the balance available in the customers account.
int customerAccountBalance;
// Denotes the type of transaction the customer wants to perform.
int transactionType;
// denotes the arrival time of the customer in the bank.
int arrivalTimestamp;
// denotes the amount of money if any transaction occurs.
int moneyInvolved;
// denotes the initial balance
int previousBalance;
public:
/**
* @brief Construct a new Customer object with random values.
*
*/
Customer() {
this->lastName = generateRandomString();
this->arrivalTime = generateRandomTime();
this->accountStatus = (bool)rand() % 2;
this->transactionType = rand() % 4;
if (this->accountStatus == true && this->transactionType) {
this->customerAccountBalance = rand() % 100000000;
} else {
this->customerAccountBalance = 0;
}
this->arrivalTimestamp = getArrivalTimeStamp(arrivalTime);
this->moneyInvolved = 0;
}
/**
* @brief Get the Arrival Time Stamp object
*
* @param arrivalTime denoting the arrival time of the customer.
* @return int that is a timestamp for the currently arrived customer.
*/
int getArrivalTimeStamp(string arrivalTime) {
return stoi(arrivalTime.substr(0, 2)) * 100 +
((float)stoi(arrivalTime.substr(3, 5)) / 6) * 10;
}
/**
* @brief Used to generate random time between 10:00AM and 1:00 PM
*
* @return string that represents the arrival time of the customer.
*/
string generateRandomTime() {
stringstream ss;
string _am = "AM";
string _pm = "PM";
int randomHours = (10 + rand() % 3);
int randomMinutes = rand() % 60;
ss << setw(2) << setfill('0') << randomHours;
ss << ":" << setw(2) << setfill('0') << randomMinutes;
if (randomHours <= 11 && randomMinutes <= 59) {
ss << "AM";
} else {
ss << "PM";
}
return ss.str();
}
/**
* @brief Used to generate a random last name of the customer.
*
* @return string that denotes the last name of the customer.
*/
string generateRandomString() {
int len = 5 + rand() % 10;
static const string alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string tmp_s;
tmp_s.reserve(len);
for (int i = 0; i < len; ++i) {
tmp_s += alphabets[rand() % (alphabets.length() - 1)];
}
return tmp_s;
}
};
/**
* @brief Used by the sort method to compare two customers based on their
* arrivalTimestamp.
*
* @param c1 a customer
* @param c2 a customer
* @return true
* @return false
*/
bool ValueCmp(Customer const &c1, Customer const &c2) {
return c1.arrivalTimestamp < c2.arrivalTimestamp;
}
/**
* @brief used as a...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here