Create File Pointers
Create File Pointers
*Declare Variables
*Create File Pointers
*Display Menu
*Receive value for menu
If option == 1
ADD ACCOUNT
Open accounts.txt as append
Enter pin code you want to add
Enter the amount u have on your atm
Print on the accounts.txt
Close file
If option == 2
CHECK BALANCE
Open accounts.txt as read
Enter pin code u want to show balance
Display the balance
Close file
If option == 3
CHANGE PIN CODE
Open accounts.txt as read
Open temp.txt as write
Enter your old pin code
Scan the pin code in accounts.txt
If the pin code you entered is equal to the text file
Enter your new pin code
Print the pin code to the temp.txt
Close both files
Open accounts.txt as write, open temp.txt as read
Create a loop to scan the temp.txt
Scan the temp.txt and print all the text on the accounts.txt
Close both files
If option == 4
WITHDRAW
Open accounts.txt as read
Open temp.txt as write
Enter pin code
Create a loop to find the pin code you entered is in accounts.txt
If entered correct pin code, proceed
Enter the amount to withdraw
Use operation to compute for withdraw (nb = cb - amt;)
Print the amount withdrawed, print your new balance
Print it to temp.txt
Close both files
Open accounts.txt as write
Open temp.txt as read
Create a loop to scan the temp.txt
Then Print all the text in the accounts.txt
Close both files
If option == 5
EXIT
Exit the program