Need assistance. How to square and cube a file or something

the problem is
Write a program that reads in a text file named “my_input.txt” that contains characters composed of digits, letters and other symbols. Then it processes the contents of the file by examining each of the characters of the file. If the character read is an alphabet, it checks its case. If it is in lowercase, then its uppercase is sent to a file named “uppercase.txt”; if in uppercase, its lowercase is sent to “lowercase.txt.” But if the character is a symbol, it is sent to “symbols.txt.” Lastly, if it is an integer, it sends its square to a file named “square.txt”, if it is even. Otherwise, it sends its cube to a file named “cube.txt” if it is odd.

I have successfully done the uppercase.txt lowercase.txt symbols.txt, but I still don't get how to do the square.txt and cube.txt :(
Topic archived. No new replies allowed.