15,962,891 members
See more:
I have to write a program like this, but I'm not that good. Please someone help me

Created file in notepad, to open and read and to make statistic for letter number (how many letters), numbers and punctuation marks, control marks and empty spaces.

The text in the file should be encoded by the rule: encoding and decoding to be done with two different functions.
Key of coding: in the text to encode only the letters from the alphabet and the numbers. Every letter in the string, which is odd position to be replaced with the letter who is two places after the replacing letter in the alphabet. The last letters Y,Z to be replaced with A,B consequently. Steam letters in the string do not suffer any changes.
Odd letters numbers to be replaced with steam numbers who are their followers and odd numbers to be replaced with their steam predecessors. 9 to encode 0 and 0 with 9. Control marks and punctuation marks do not suffer any changes. Treated like this file to be saved under a different name and be called decode.
Posted
Updated 10-May-11 14:55pm
v3
Niklas L 10-May-11 9:28am

## Solution 4

Homework and Gimmecode in the same question... :rolleyes:

Well...

- Get familiar on how should you open and work with files...
- Once you've learnt how to open files, read the content.
- You will need to use a bucle, an interator (the one that a 2 modulus operation will tell you if it is even or odd).
- Calling a function to make the replacement should be easy if you do it char by char...
- You will need a string to store the encoded text.
- Then you will have to write that text into a new file...

This is a nice homework... fun and interesting to learn the basics...

Try it and enjoy doing it... keep in mind that knowing those things are the minimum to make any IT work out there so better learn it well...

HTH! :thumbsup:

Marc A. Brown 10-May-11 11:26am
Joan M 10-May-11 11:38am
Thank you Marc!

## Solution 1

You should do your own homework and ask here just specific questions when you are stuck (you didn't read the FAQ, did you?).
After all, the requirements are clear hence the task should be straightforward.

Niklas L 10-May-11 9:23am
Comment from OP:
"no i didn't..
it should be done till friday..

"i'll try something,
when i stuck somewhere i'll post here"