Hi everyone :) I've been given a project which asks to write a code in c++ language about bank management system. the result should be three options: depositing, withdrawing, and checking the balance. this should be done using a file to store the users name, account no. , and the balance and without using classes. i wrote a code which can do that but without using a file and only for one client . this is my code :
it is working so well but i dont know how to use a file in here, so if the user enters an account no. the code will search in the file and deal with that person's information. i think i should use arrays and i have tried soo many times! but it didnt work. I just need a simple explanation of what I need to do :)
Arrays? That could work. It depends on what you want. If you want the program to store the information even when the program is closed or the users computer is shut down then you should use a file.... Think of files as electronic storage =].
First off, are they supposed to be able to withdraw more than there account has? I would some logic to make sure that can't happen.
For the file reading, use getline to get how ever many lines you need. So say you store all the info for a customer on one line, you'll just get the line that begins with account number x and print it out somewhere. Or if you store each piece of information on a line under account number x, just getline for how ever many pieces of info are attached to an account