Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey tutors, I need help with this c++ class exercise Solution Explorer BankAccount.h Client.cpp BankAccount.cpp + x BankAccount BankAccount(const std:string acNum) BankAccount Search Solution Explorer

Hey tutors, I need help with this c++ class exercise

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Solution Explorer BankAccount.h Client.cpp BankAccount.cpp + x BankAccount BankAccount(const std:string acNum) BankAccount Search Solution Explorer (Ctri+;) #include "BankAccount.h" Solution 'BankAccount' (1 of 1 project) #include BankAccount 0-0 References BankAccount : : BankAccount() External Dependencies Header Files Resource Files std: : cout Solution 'BankAccount' (1 of 1 project) Eclass BankAccount BankAccount 0-0 References 4 External Dependencies 5 private: //access specifier (modifier) . Client code does not have DIRECT to them. Header Files / /attributes, Data members Resource Files Source Files //public: //bad choice, not recomended ++ BankAccount.cpp std: : string accountNumber; BankAccount.h double accountBalance = 0; //initiallizing ++ Client.cpp 10 / /behaviors , methods, operations, function members 12 public: 13 BankAccount(); //a default constructor 14 BankAccount(const std: : string) ; // another constructor 15 BankAccount (const std: : string, const double) ; 16 17 void deposit(double) ; 18 double checkBalance(); 19 //challenge: write a fucntion to set the account number to some string provided by the user void setAccountNumber(std: : string ); //setter /mutator std: : string getAccountNumber(); //getter/ accessorBankAccount.h Client.cpp + X BankAccount.cpp Solution Explorer (Global Scope) main() + BankAccount #include "BankAccount.h" //Notice the double quotation marks, since this is a programmer created Search Solution Explorer (Ctri+;) //file. Not coming from the system 'libraries' Solution 'BankAccount' (1 of 1 project) BankAccount D-D References #include External Dependencies Ly Header Files Resource Files using std: :cout; Source Files ++ BankAccount.cpp int main() D h BankAccount.h ++ Client.cpp 10 / /BankAccount account; //declare a variable of type BankAccount 11 BankAccount anotherAccount("123abc") ; 12 13 / /Create an ' instance' object of type BankAccount 14 15 //account . deposit(25. 50) ; //calling the 'instance' function deposit 16 17 //cout ( : & const Book) : bool -use year to compare objects of type year. +operator

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions