hey.. im new in c++ and im doing an engineering journal as my assignment.. i dun know how to do this..
Entries in the journal are private, so the journal is encoded and protected using a pin. When the program is executed it will ask for a 4-digit pin. The pin is to be stored in the program as an integer array.
When saving the file, each character in the journal paragraph is to have the integer value of the next digit in the pin added to the character to encode. When decoding the file, the next digit in the pin is subtracted from the character.
To encode the entry when saving to file:
The first digit will be added to the first character of the text.
The second digit will be added to the second character of the text.
The third digit will be added to the third character of the text.
The fourth digit will be added to the fourth character of the text.
… and so the cycle repeats.
The first digit will be added to the fifth character of the text.
…
E.g. if using the pin 1234, the entry abcdefg would be encoded bdfhfhj
Hint: strings are arrays of characters and numbers can be added to strings, e.g. myString[0] + 1
pls help me=(