I am writing a program that reads a file. If the character read is a C, it will grab the next line which will be a radius of a circle, if the character is an R, it will obtain the next to lines which are the length and width of a reactangle, and so forth. After the program obtains the radius (for example), I need to have a fuction calculate the area of that circle based on the radius given from the file. After that, the program should send that area to a new file. How do I go about doing this? I've been trying for hours, but haven't gotten anywhere.
Any ideas would be appreciated. Thank you.