Answer to Question #287133 in C++ for Kay

Question #287133

Develop a c++ menu driven application to keep track of physical human intellectual and financial resources for department of computer science. When app starts, it must display a list of all possible operations one can perform. Use user-defined data type to cater for each resource


1
Expert's answer
2022-01-13T12:32:27-0500
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <stdio.h>
using namespace std;


class Bank {
    string name, address;
    char acc_type;
    float amount;


public:
    void create_account();
    void deposit_money();
    void withdraw_money();
    void show_account();
};


void Bank::create_account()
{
    name = "Aman Jhurani";
    cout << "Enter your full name: "
        << name << endl;
    address = "Hello";
    cout << "Address: "
        << address << endl;
    acc_type = 'S';
    cout << "What type of account you want"
        << " to open saving(S) or Current(C): "
        << acc_type << endl;
    amount = 8000;
    cout << "Enter How much money you want to deposit: "
        << amount << endl;
    cout << "Account Created Successfully";
}


void Bank::deposit_money()
{
    int Amount;
    Amount = 9500;
    cout << "Enter how much money"
        << " you want to deposit: "
        << Amount << endl;
    amount += Amount;
    cout << "\n Available amount: "
        << amount;
}


void Bank::show_account()
{
    cout << "Name: " << name << endl
        << "Address: " << address << endl
        << "Type: " << acc_type << endl
        << "amount: " << amount << endl
        << endl;
}


void Bank::withdraw_money()
{
    float amount;
    amount = 3200;
    cout << "Enter how much money "
        << "you want to withdraw: "
        << amount << endl;
    amount -= amount;
    cout << "\n Available amount: "
        << amount;
}


int main()
{
    int option;


    Bank client;


    cout << "\n1) Open account \n\n";


    client.create_account();
    cout << "\n------------------------"
        << "-------------------------\n";


    cout << "\n2) Deposit account \n\n";


    client.deposit_money();
    cout << "\n------------------------"
        << "-------------------------\n";


    cout << "\n2) Withdraw money \n\n";


    client.withdraw_money();
    cout << "\n------------------------"
        << "-------------------------\n";


    cout << "\n4) Display Account \n\n";


    client.show_account();
    cout << "\n------------------------"
        << "-------------------------\n";


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment