No. You must understand that void is a return type which returns nothing. You are trying to return ints , strings, and doubles on void. Just change them to the proper return types and it should be fine. Also you might want to have a public constructor otherwise how are you going to initialize the account number, name , and balance.
a) code tags!!!!
b) cstring
d) reposting the code doesnt help
e)well it certainly looks like it would compile, but past that, we dont know what you mean by right
sir actually my question is this:
1. Define a class to represent a “Bank Account.” Each bank account should, at least, have:
a. an account number
b. account holder’s name, and
c. balance.
Protect the state of each bank account and information regarding implementation by providing relevant public to get and set the state variable of the class. Provide definitions of at least the following:
With the last methods, the added return value allows you to use the updated balance as a value when the function finishes. e.g.
1 2
double new_balance=current_account.withdraw(withdraw_amount);
cout<<"You have withdrawn $"<<withdraw_amount<<". Your remaining balance is $"<<new_balance<<"\n";
Which is why you would declare double deposit()
instead of void deposit() //no return value. return statement omitted