Hi guys,
This is the first time I have worked with files, up until now I have just worked with compiling functions to the command screen. I have a project where I need to read-in a text file, multiple each variable by a certain percentage and output a file with the results.
The input file looks something like:
Mike 90,80,75,100,100
Each value then needs to be multiplied by a certain weighted percentage and the output file would then return a letter grade, like:
Mike B
There can be many lines of people/scores....
Here is the code I have so far, and is where I am stuck. I have read in the file, now I am trying to figure out what to do next. I figured this part out by reading my book, and it was pretty clear how to do this part, but I am not sure how to proceed. I know I need to do something with the string to get it multiplied, but I am not sure how:
Any help would be appreciated. ThanksCode:#include <stdio.h> int main(void) { int ch; FILE * fp; fp = fopen("C:\\Documents and Settings\\name\\Desktop\\Final_Input.txt", "r"); ch = getc (fp); while (ch != EOF) { putchar(ch); ch= getc(fp); } }



LinkBack URL
About LinkBacks



