I ain't want to do this but I'm about to go crazy over here.

Basically I have to take the Gettysburg Address and convert it into pig latin.
I have to take the first letter of each word, put it at the end of the word and add an "ay" at the end. So for example "Four score and seven" would be "Ourfay coresay ndaay evensay." After that I have to count the number of words, letters and characters in the file.
The 2nd part is easy but the actual converting the text into pig latin has me losing my mind. I've been going at it for the last three days and I just can't figure it out.
The professor says to process each letter one at a time but I don't know how to store the letter and put it into the end of the word.
This is what my main is looking like
Basically this puts an ay at the end of every word except for words that start a new line.
I just need help with the converting to pig latin part, I can do the word/letter counting. I'm not asking you to do my assignment but any hints/advice would be helpful.
EDIT: Btw this is what I get when I run the program in the OP.