omar_02

Distinguished
Apr 23, 2010
2
0
18,510
1. Open the file w.pdf to read. You are to write a series of statements that computes the number of bytes in w.pdf and in a printf statement output the number of bytes in the file w.pdf.
2. Open a file new.pdf to write. You need to read each character from w.pdf and write to new.pdf
3. Declare an array
long freq[256]={0};
Reset the file position indicator to the beginning of the file for the file w.pdf , read each character in w.pdf and determine how many times each character occurs in the file.
example if ch==i then freq++
after reading the entire file output the frequency count in a formatted manner printing six frequencies on each line.
4. (optional) An example of a weak encryption: reset the file position indicator to the beginning of the file for the file w.pdf and open a file called encryptFile. Prompt the user to enter an unsigned long, assign it to an unsigned long called key. Read each byte B from w.pdf and write the byte C= B^ (key & 0xff). Then set key=(key<<8)| (C&0xff) and then continue this process or reading and writing until EOF
5. (extra credit must be turned in to the instructor) Write a function that will decrypt your encrypted file encryptFile.


help me

dilaal1@hotmail.com

 

mindless728

Distinguished
Jul 15, 2008
130
0
18,660
you should do this yourself though here is some reference stuff that will help http://www.cplusplus.com/reference/clibrary/cstdio/

its a c++ site, though this is the stdio library for c, these are all of the functions that have to do with files in c
 

omar_02

Distinguished
Apr 23, 2010
2
0
18,510
1. Open the file w.pdf to read. You are to write a series of statements that computes the number of bytes in w.pdf and in a printf statement output the number of bytes in the file w.pdf.
2. Open a file new.pdf to write. You need to read each character from w.pdf and write to new.pdf
3. Declare an array
long freq[256]={0};
Reset the file position indicator to the beginning of the file for the file w.pdf , read each character in w.pdf and determine how many times each character occurs in the file.
example if ch==i then freq++
after reading the entire file output the frequency count in a formatted manner printing six frequencies on each line.
4. (optional) An example of a weak encryption: reset the file position indicator to the beginning of the file for the file w.pdf and open a file called encryptFile. Prompt the user to enter an unsigned long, assign it to an unsigned long called key. Read each byte B from w.pdf and write the byte C= B^ (key & 0xff). Then set key=(key<<8)| (C&0xff) and then continue this process or reading and writing until EOF
5. (extra credit must be turned in to the instructor) Write a function that will decrypt your encrypted file encryptFile.