Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please read all of it: GUI use required Create a Deposit class for a checkbook.

ID: 3807242 • Letter: P

Question

Please read all of it: GUI use required

Create a Deposit class for a checkbook.

The Deposit class will be able to get a Transaction number, date, description of the transaction, the deposit amount and calculate a new balance.

The user should be asked if they want to deposit, withdraw, or set a goal, again.

The user must have the option to Finish and display the final balance or exit the program.

Methods that must be used for the Deposit class: Math operators, Array List, loop, GUI

The user will be asked to use a + or – in front of the number entered to add or decrease from balance.

An Array List will keep all current transactions, then it will remove previous transactions.

Methods that must be used for Transaction:   JComboBox, Scanner, Loops

The user should select from a list (gas, food or bills) or be able to manually enter a type of transaction.

The user receives an error if they enter anything that is not a character string.

The user will also be asked to accept after entering it to confirm their entry.

If entry is not suitable they should be allowed to reselect or enter a new entry.

Method that must be used for the Date: set Local Date

Transactions that the user makes are dated.

The user must be prompted of the last time they logged in.

Explanation / Answer

#include<iostream.h>
#include<string.h>
#include<process.h>

class details
{
   public:
       char *name;
       int age;
       char branch[50];
       char city[40];
       void getdetails()
       {
           name=new char[20];
           cout<<endl<<endl<<"**********Customer Details*********** "<<endl;
           cout<<" -------- ------- "<<endl;
           cout<<"Enter Name: ";
           cin>>name;
           cout<<"Enter Age: ";
           cin>>age;
           cout<<"Enter Branch: ";
           cin>>branch;
           cout<<"Enter City: ";
           cin>>city;
           cout<<"______________________________________"<<endl<<endl;
       }
};

class bank
{

   public:
       static int accnumber;
       long balance;
       details d;
       void getdata();
       bank transfermoney(bank);
       void deposit();
       void withdrawal();
       void newaccount();
       void viewaccdetails();
};
int bank::accno=0;

void main()
{
   char ch;
   static int i=0;
   bank *a[10];
   int x,amt,k,j;
   clrscr();
   do
   {
   cout<<endl<<endl<<"************MENU************"<<endl;
   cout<<" ---- "<<endl;
   cout<<"1.Create new account 2.Deposit 3.Withdraw 4.Transfer credits 5.View account details ";
   cout<<"Enter choice no.: ";
   cin>>x;
   switch(x)
   {
       case 1:
       {
           i++;
           a[i]=new bank;
           a[i]->newaccount();
           break;
       }
       case 2:
       {
           cout<<"Enter account no.: ";
           cin>>k;
           a[k]->deposit();
           break;
       }
       case 3:
       {
           cout<<"Enter account no.: ";
           cin>>k;
           a[k]->withdrawal();
           break;
       }
       case 4:
       {
           cout<<"Enter the source and destination account nos.: ";
           cin>>k>>j;
           *a[j]=a[k]->transfermoney(*a[j]);
           break;
       }
       case 5:
       {
           cout<<"Enter account no.: ";
           cin>>k;
           a[k]->viewaccdetails();
           break;
       }
   }cout<<" Do you wish to continue[Press 'Y' to continue or 'N' to exit menu]: ";
   cin>>ch;
}while(ch=='y'||ch=='Y');

}

bank bank::transfermoney(bank a)
{
   long amt;
   cout<<"Enter amount to be transferred: ";
   cin>>amt;
   a.balance=a.balance+amt;
   if(balance<amt)
   {
       cout<<" Insufficient balance! Operation Cannot be performed!"<<endl<<endl;
   }
   else
   {
       balance=balance-amt;
   }
   return a;
}
void bank::withdrawal()
{
   long amtdrawn;
   cout<<"Enter amount to be withdrawn: ";
   cin>>amtdrawn;
   if(balance<amtdrawn)
       cout<<" Insufficient balance! Operation Cannot be performed!"<<endl<<endl;
   else
       balance=balance-amtdrawn;

}
void bank::deposit()
{
   long dep;
   cout<<"Enter amount to be deposited: ";
   cin>>dep;
   balance+=dep;
}
void bank::newaccount()
{
   accno++;
   d.getdetails();
   balance=0;
}
void bank::viewaccdetails()
{
   cout<<endl<<endl<<"*********ASSIGNMENT BANK ACCOUNT DETAILS*********"<<endl;
   cout<<" --- ---- ------- ------- "<<endl;
   cout<<"Account no.: "<<accno<<endl;
   cout<<"Name: "<<d.name<<endl;
   cout<<"Branch: "<<d.branch<<endl;
   cout<<"City: "<<d.city<<endl;
   cout<<"Current Balance: "<<balance<<endl;
   cout<<"_________________________________________"<<endl;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote