/* * bankAccount * Instructions: * Create a BankAccount - TopicsExpress



          

/* * bankAccount * Instructions: * Create a BankAccount Structure that contains two fields, one for an integer *called accountNumber and one for a double called accountBalance. Create a main *program that prompts the user for a 4 digit account number and a beginning *balance for two accounts. Create a check digit that is the remainder of the *account number when it is divided by 5. This digit should be added to the end *of the 4 digit account number. Store the account number and the beginning *balance in each BankAccount Object... * * Sample Output: * First account: Enter account number >> 1234 * Enter balance >> 5 * Second account: Enter account number >> 5678 * Enter balance >> 3 * * Account #12344 had a starting balance of $5 * Account #56783 had a starting balance of $3 * * Created on October 28, 2013, 11:44 PM */ #include // Standard C library... #include // Contains cout, cin objects... #include #include BankAccount.h // Contains the C++ construct string(class)... using namespace std; /* * This function prompts the user for an account number, and balance for two *accounts, then divides the account number by five and holds the remainder *(checkDigit), and adds that number on the end of the account number to make a *five digit account number... */ int main(int argc, char** argv) { BankAccount accountNumber1, accountNumber2; BankAccount accountBalance1, accountBalance2; int checkDigit; cout > accountNumber1.accountNumber; checkDigit = accountNumber1.accountNumber % 5; accountNumber1.accountNumber = accountNumber1.accountNumber * 10 + checkDigit; cout > accountBalance1.accountBalance; cout > accountNumber2.accountNumber; checkDigit = accountNumber2.accountNumber % 5; accountNumber2.accountNumber = accountNumber2.accountNumber * 10 + checkDigit; cout > accountBalance2.accountBalance; cout
Posted on: Wed, 30 Oct 2013 03:52:54 +0000

Trending Topics



Recently Viewed Topics




© 2015