PROVIDE PSEUDOCODE, MANUAL COMPUTATION, FLOWCHART PLS THANKS! make a simple banking system. assume that the bank has three (3) tellers that take turns in serving the customers. Each customer should have at least the following parameters: Account Number, Account Name, Transaction Type (Withdraw, Deposit), Transaction Amount (in Php), and Average Transaction Time (in minutes). The program should ask first the number of customers to serve, then asks the details for each customer. Input at least 10 customer details. The program should output the transaction log of the 3 tellers. Each transaction log entry should contain the customer's account number, account name, the amount withdrawn/deposited, and the remaining account balance. Note: Each customer account must have an initial balance of Php 10,000.00.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

modify the provided C++ code below and add this:

  • PROVIDE PSEUDOCODE, MANUAL COMPUTATION, FLOWCHART PLS THANKS!
  • make a simple banking system. assume that the bank has three (3) tellers that take turns in serving the customers. Each customer should have at least the following parameters: Account Number, Account Name, Transaction Type (Withdraw, Deposit), Transaction Amount (in Php), and Average Transaction Time (in minutes).
  • The program should ask first the number of customers to serve, then asks the details for each customer. Input at least 10 customer details. The program should output the transaction log of the 3 tellers. Each transaction log entry should contain the customer's account number, account name, the amount withdrawn/deposited, and the remaining account balance.
  • Note: Each customer account must have an initial balance of Php 10,000.00.

C++ code:

#include <iostream>
#include <cstdlib>
#include <ctime>

class student_queue {
public:
    struct node {
        int num;
        node* prev;
        node* next;
    };
    
    student_queue() {
        head = nullptr;
        tail = nullptr;
        count = 0;
    }
    
    ~student_queue() {
        clear();
    }
    
    node* front() const {
        return head;
    }
    
    node* back() const {
        return tail;
    }
    
    void push(int num) {
        node* newNode = new node;
        newNode->num = num;
        newNode->prev = tail;
        newNode->next = nullptr;
        
        if (tail == nullptr) {
            head = newNode;
        }
        else {
            tail->next = newNode;
        }
        
        tail = newNode;
        count++;
    }
    
    void pop() {
        if (head == nullptr) {
            return;
        }
        
        node* oldHead = head;
        head = head->next;
        
        if (head == nullptr) {
            tail = nullptr;
        }
        else {
            head->prev = nullptr;
        }
        
        count--;
        delete oldHead;
    }
    
    bool empty() const {
        return count == 0;
    }
    
    int size() const {
        return count;
    }
    
    void clear() {
        while (head != nullptr) {
            node* temp = head;
            head = head->next;
            delete temp;
        }
        
        tail = nullptr;
        count = 0;
    }
    
private:
    node* head;
    node* tail;
    int count;
};

int main() {
    // Create a student_queue object
    student_queue q;
    
    // Add some random values to the queue
    std::srand(std::time(nullptr));
    for (int i = 0; i < 10; i++) {
        int num = std::rand() % 20 - 10;
        q.push(num);
    }
    
    // Print the queue forward
    std::cout << "Queue elements: ";
    student_queue::node* cur = q.front();
    while (cur != nullptr) {
        std::cout << cur->num << " ";
        cur = cur->next;
    }
    std::cout << std::endl;
    
    // Print the front and back elements
    std::cout << "Front element: " << q.front()->num << std::endl;
    std::cout << "Back element: " << q.back()->num << std::endl;
    
    // Remove some elements from the queue
    std::cout << "Removing some elements from the queue..." << std::endl;
    q.pop();
    q.pop();
    
    // Print the updated queue forward
    std::cout << "Updated queue elements: ";
    cur = q.front();
    while (cur != nullptr) {
        std::cout << cur->num << " ";
        cur = cur->next;
    }
    std::cout << std::endl;
    
    // Print the size of the queue
    std::cout << "Queue size: " << q.size() << std::endl;
    
    // Clear the queue
    q.clear();
    std::cout << "Queue cleared. Size is now: " << q.size() << std::endl;
    
    return 0;
}

 

Expert Solution
steps

Step by step

Solved in 7 steps with 9 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education