Menu

[Solved]Write C Program Simulates Operation Simple Online Banking System Program Starts Displayin Q37192489

Write a C++ program that simulates the operation of a simple online banking system. The program starts by displaying its ma2. When choice 2 (withdrawal money) is selected, the program should ask the user to enter withdrawal amount which should be vTable 1. Credit card types based on the starting digit (left to right) Card Type Starting Digit American Express Visa MasterCThe following credit card numbers can be used to test your program Card Number 5278576018410707 373800410401774 4388576018402G. All the program must be indented properly wherever is needed/required. For example, the bodies of looping structures, if s

Write the program on “Xcode” for MacOs.

Write a C++ program that simulates the operation of a “simple online banking system”. The program starts by displaying its main menu as shown in Figure 1. I welcome To ELEC 230 Banking System I 1. Display Account Information withdraw Money 3. Deposit Money . Verify Your Credit Card 5. ouit Application elect Your choice: Figure 1 Main menu of the program The menu is composed of the following choice:s 1. When choice 1 is selected (Display Account information), the program should display account information and account balance. This information (account information and account balance) is stored in two separate text files “accountlnfo.txt” and “balance.txt”, respectively. Figure 2 shows sample examples of these two files Accountinfo.bxt- Notepad File Edit Format View Help First Name: your first name Last Name: your last name Account Number: 99988811231 Date of Birth: 12/4/2019 Email: yourName@uaeu.ac.ae Balance.txt – Notepad File Edit Format View Help 25000 Windows’ Ln 6, Col . 100% Windows Ln 1, Col( 100% Figure 2 Text files: accountinfo.txt and balance.txt Once choice 1 is selected, the content of these files should be displayed as shown in Figure 3. After that the program start over displaying the main menu again once the Enter Key is pressed First Name: your first name Last Name: your last name Account Number: 99988811231 Date of Birth 12/4/2019 Email: yourNameuaeu.ac.ae The Balance is :AED 25000 Figure 3 Output of “Display Account Information” choice 2. When choice 2 (withdrawal money) is selected, the program should ask the user to enter withdrawal amount which should be validated (withdrawal amount should be positive and less than the account balance). This shown in Figure 4 You Are About to Withdraw From Your Account. Your Current Balance: 1500 Enter Withdrawal Amount: 20000 You Are About to Withdraw From Your Account. Your Current Balance: 1500 Enter withdrawal Amount: -677 You Are About to withdraw From Your Account. Your Current Balance: 1500 Enter Withdrawal Amount: Figure 4 Withdrawal selection and validation Once a valid value is entered, it should be subtracted from the balance value, which is stored in file “balance.txt”, and then the file should be updated with the new balance value. To update the file you need to open the file for output; the new balance value is then can be saved to the file removing the old value. This can be done in C+using the following fstream outFile; outFile.open (“balance.txt”, ios::out | ios::trunc); where: (ios::out) for output mode, (ios::trunc) for removing the file content if it does exist, and for combining both operation opening as output file and removing its old content 3. When choice 3 (Deposit) is selected, the program should ask the user to enter deposit amount which should be validated as positive value only. Once a valid value is entered, it should be added to the balance value, which is stored in file “balance.txt”, and then the file should be updated with the new balance value. This also can be accomplished as explained in point 2 above 4. When choice 4 (Verify Your Credit Card) is selected, the program should read your credit card (for example: 5278576018410707) and verify whether it is valid or not In addition, the program must display the type (i.e. name of the company that produced the card) Each credit card must start with a specific digit (starting digit: 1st digit from left to right), which also is used to determine the card type according Table 1 Table 1. Credit card types based on the starting digit (left to right) Card Type Starting Digit American Express Visa MasterCard Discover Card 4 The total number of digits of a credit card number must be between 13 to 16 digits. In addition, your program should validate credit card numbers according to Luhn Rule that is basically can be described as follows (as an illustration, the rules will be applied to the credit card number 4388576018402626) A. Double every even digit from right to left. If the doubling results in two digits number, sum the digits to get a single digit number Position 16 Card Num 2 2 4 2 2 4 4 2 8 1*2=2 62 12 2) 3 5.2=10″> (1 +0)=1 82-16(1+6)- B. Compute the sum of single digit numbers obtained from step A above C. Compute the sum of every odd digit from right to left: D. Compute the sum of the results from step B and step C E. If the total sum from step D is divisible by 10, the card number is valid. Otherwise, it is Sum of even single-digits4+4+ 8+2+3+1+7+837 Sum of odd digits 6608+ 0+ 7+8+3 38 Total sum37 38 75 not valid Is 75 divisible by 10 (without remainder)? No, the card number in this example is Invalid. Sample examples of this menu choice is shown in Figure 5 nter credit Card Number 5278576018410O7O7 Enter Credit Card Number: 601195764182 heCredit Card Number is valid It Belongs to: MasterCard he Credit Card Number is Invalid ress Enter Key To Start over Press Enter Key To Start over Figure 5 Credit Card Number Verification The following credit card numbers can be used to test your program Card Number 5278576018410707 373800410401774 4388576018402626 601195764182 Valid? Yes Yes No No Card Type MasterCard American Express 5. When choice 5 (Quit Application) is selected, the program should stop 6. After displaying each selection, you need to clear the screen. In windows, you can use the function call system(“cls”);. But in MacoS using the xcode, the best way to do it is by using something like: cout << string( 100, ‘n’ ); Notes: to get the full credit of the project, you should follow these notes A. You should use functions wherever possible B. There should be two text files in your project folder. You can use the information shown in Figure 2. Your program should display appropriate error messages if any of these files cannot be opened or found C. Credit card numbers are usually large, so use long long to represent the corresponding variables of this value D. The project should be done in groups of two students E. Names, IDs, and section of students must be written as comments at the top of the file. // Students Names&IDs // Section: F. The deadline of the project will be the last day of classes 01/05/2019. You should come and discuss your project implementation during office hours or by appointment before the deadline expiry. No late discussions will be accepted G. All the program must be indented properly wherever is needed/required. For example, the bodies of looping structures, if statements, user-defined functions etc. Show transcribed image text Write a C++ program that simulates the operation of a “simple online banking system”. The program starts by displaying its main menu as shown in Figure 1. I welcome To ELEC 230 Banking System I 1. Display Account Information withdraw Money 3. Deposit Money . Verify Your Credit Card 5. ouit Application elect Your choice: Figure 1 Main menu of the program The menu is composed of the following choice:s 1. When choice 1 is selected (Display Account information), the program should display account information and account balance. This information (account information and account balance) is stored in two separate text files “accountlnfo.txt” and “balance.txt”, respectively. Figure 2 shows sample examples of these two files Accountinfo.bxt- Notepad File Edit Format View Help First Name: your first name Last Name: your last name Account Number: 99988811231 Date of Birth: 12/4/2019 Email: yourName@uaeu.ac.ae Balance.txt – Notepad File Edit Format View Help 25000 Windows’ Ln 6, Col . 100% Windows Ln 1, Col( 100% Figure 2 Text files: accountinfo.txt and balance.txt Once choice 1 is selected, the content of these files should be displayed as shown in Figure 3. After that the program start over displaying the main menu again once the Enter Key is pressed First Name: your first name Last Name: your last name Account Number: 99988811231 Date of Birth 12/4/2019 Email: yourNameuaeu.ac.ae The Balance is :AED 25000 Figure 3 Output of “Display Account Information” choice
2. When choice 2 (withdrawal money) is selected, the program should ask the user to enter withdrawal amount which should be validated (withdrawal amount should be positive and less than the account balance). This shown in Figure 4 You Are About to Withdraw From Your Account. Your Current Balance: 1500 Enter Withdrawal Amount: 20000 You Are About to Withdraw From Your Account. Your Current Balance: 1500 Enter withdrawal Amount: -677 You Are About to withdraw From Your Account. Your Current Balance: 1500 Enter Withdrawal Amount: Figure 4 Withdrawal selection and validation Once a valid value is entered, it should be subtracted from the balance value, which is stored in file “balance.txt”, and then the file should be updated with the new balance value. To update the file you need to open the file for output; the new balance value is then can be saved to the file removing the old value. This can be done in C+using the following fstream outFile; outFile.open (“balance.txt”, ios::out | ios::trunc); where: (ios::out) for output mode, (ios::trunc) for removing the file content if it does exist, and for combining both operation opening as output file and removing its old content 3. When choice 3 (Deposit) is selected, the program should ask the user to enter deposit amount which should be validated as positive value only. Once a valid value is entered, it should be added to the balance value, which is stored in file “balance.txt”, and then the file should be updated with the new balance value. This also can be accomplished as explained in point 2 above 4. When choice 4 (Verify Your Credit Card) is selected, the program should read your credit card (for example: 5278576018410707) and verify whether it is valid or not In addition, the program must display the type (i.e. name of the company that produced the card) Each credit card must start with a specific digit (starting digit: 1st digit from left to right), which also is used to determine the card type according Table 1
Table 1. Credit card types based on the starting digit (left to right) Card Type Starting Digit American Express Visa MasterCard Discover Card 4 The total number of digits of a credit card number must be between 13 to 16 digits. In addition, your program should validate credit card numbers according to Luhn Rule that is basically can be described as follows (as an illustration, the rules will be applied to the credit card number 4388576018402626) A. Double every even digit from right to left. If the doubling results in two digits number, sum the digits to get a single digit number Position 16 Card Num 2 2 4 2 2 4 4 2 8 1*2=2 62 12 2) 3 5.2=10″> (1 +0)=1 82-16(1+6)- B. Compute the sum of single digit numbers obtained from step A above C. Compute the sum of every odd digit from right to left: D. Compute the sum of the results from step B and step C E. If the total sum from step D is divisible by 10, the card number is valid. Otherwise, it is Sum of even single-digits4+4+ 8+2+3+1+7+837 Sum of odd digits 6608+ 0+ 7+8+3 38 Total sum37 38 75 not valid Is 75 divisible by 10 (without remainder)? No, the card number in this example is Invalid. Sample examples of this menu choice is shown in Figure 5 nter credit Card Number 5278576018410O7O7 Enter Credit Card Number: 601195764182 heCredit Card Number is valid It Belongs to: MasterCard he Credit Card Number is Invalid ress Enter Key To Start over Press Enter Key To Start over Figure 5 Credit Card Number Verification
The following credit card numbers can be used to test your program Card Number 5278576018410707 373800410401774 4388576018402626 601195764182 Valid? Yes Yes No No Card Type MasterCard American Express 5. When choice 5 (Quit Application) is selected, the program should stop 6. After displaying each selection, you need to clear the screen. In windows, you can use the function call system(“cls”);. But in MacoS using the xcode, the best way to do it is by using something like: cout

Expert Answer


Answer to Write the program on “Xcode” for MacOs…. . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *