Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- char getTypeAcc();
- int getAccNum();
- char accountType;
- int accountNum;
- accountNum= getAccNum();
- accountType= getTypeAcc();
- }
- // get account number
- int getAccNum() {
- int num;
- cout << "Enter account number: ";
- cin >> num;
- while(num <= 0) {
- cout << "Error!";
- cout << "\nEnter account number: ";
- cin >> num;
- }
- return num;
- }
- // get the type of account
- char getTypeAcc() {
- char type;
- cout << "Enter account type: ";
- cin >> type;
- while(type != 'c','C','p','P') {
- cout << "Account type must be C or P!";
- cout << "\nEnter the account type: ";
- cin >> type;
- }
- return type;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement