Data need to be saved somewhere. The reason being, if all data are stored in memory and the computer get accidentally turned off. The effect would be epidemic!
Data output using fstream are clear text by default! ENCRYPT any sensitive info before output to file!!!!!
Some text file are delimited in a certain way, for example below.
sample of comma delimited file=> aa,bb,cc
sample of semicol delimited file=>aa;bb;cc
File operations of the program, should be able to read in the lines, and "parse" the input accordingly and stored into the required variable.
This usually happens when legacy software needed an upgrade to the most-IN technology (Programmer Guru Mantra= If it ain't spoil, don't fix it). However, the data are not compatible. One common feature of software, it has the ability to "dump" data out of the system.
As as programmer, we need to write code to extract those that required to the new system. Therefore, we still get to keep our jobs, make ourself valuable.
Regarding on the issue of Out Sourcing to other country. Fret Not. Why would the company would entrust their data to a 3rd party other then their employer? The audit trail of hands dipped into the data would be clearer and easier to trace. Hence the accountability.
With Great monies, comes great responsibilities.
Talking about file IO and security, take a look at the game below.
I played the game when i was still a teenager like most of you. My friend challenged me to complete the game (eg Lvl 99) in the shortest possible time. Few of us, being kiasu (hokkien colloquial for afraid to loose), keep comparing each other's progress. Me, for being me went to my usual corner and gave my friend Lvl99 at the end of the day. Guess how I manage to get it done????
The sample of file operations are in the writescore.cpp and readscore.cpp. Compile and run it to get a feel of how File I/O is done.
1. Write a program that READS IN records (eg A.txt) that are semicol delimited eg
tom 19 dcpe/2B/01 DSA B+;kelly 18 dcpe/2B/01 DSA A; .....
2. Write a program that WRITE OUT records (eg B.txt) that are semicol delimited eg
tom 19 dcpe/2B/01 DSA B+; kelly 18 dcpe/2B/01 DSA A; ....
3. write a program that reads in Q1 but modifies to comma delimited and output to a new file.
HINT: It is good to have a menu driven system to choose between the options instead of running 2 cpp projects concurrently.