heres my code now. but all its doing is reading the whole txt file. I need it to create a outputGrades.txt file with the 3 columns of student ID Grade % and Letter grade. any advice ?
ok so now here is my code and i what it outputs is the whole txt file.. then i have an outputgrades.txt file with my 3 columns which i need and the number of which letter grades so that is better. But there are no numbers calculated under the columns. only the 1 number of like 312000. any advice would be appreciated :)
wow JL you are such a good dude ! thank you :) a couple questions.
what im supposed to do is to have 3 columns:
--> ID | Grade(%) | Letter Grade
- That ^ is supposed to be in an outputGrades.txt file.
ThenI have to have my program output *in xcode (to the screen)* these columns:
--> Letter Grade | Count of said letter | Attendance %
-So i just want my program to output my first 3 columns to an output.txt file then ill try and figure out the 2nd part.
-But when you say write record to output file what do you mean by that ??
do you mean this ?
-and when you say write totals , you are saying to go through all 137 lines of my txt input file and calculate it myself ? sorry maybe i am misunderstanding. Than you JL. im learning as we speak
so i have this now and the build succeeded but there was no outputGrades4.txt in my debug directory where it should be
-here is code. is this what you suggested i do?
hey kemort ! thank you
this is what i got when i used that code for the first 30 lines. the course grade numbers are actually there attendance
ID Course Grade Letter Grade
1 9 F
2 8 F
3 24 F
4 25 F
5 21 F
6 24 F
7 17 F
8 25 F
9 23 F
10 24 F
11 22 F
12 23 F
13 11 F
14 24 F
15 23 F
16 23 F
17 23 F
18 22 F
19 7 F
20 24 F
All you have to do is complete the list of your variables at line 44 and it will read and process the data completely including output if you track it through. I changed line 47 to LetterGrade simply to get output. Just change it back to what you had originally.
As far as headings are concerned all you do is modify line 38. And if you get rid of the setw,s on that line and just type out the heading in full you'll find it easier.
No. of students: 137
ID Attendance hw1 hw2 hw3 hw4 hw5 hw6 hw7 exam1 exam2 finalExam
ID Course Grade Letter Grade
199879100100850100242432 F
28105105000002300 F
32410595105100969897252537 F
42598.7105105105103.95104105222139 F
52194.5989295909090.3201530 F
62495.55100991009260105242132 F
71790958290.3689960231425 F
82590102.998.795.551007210521233
you have to put additional formatting spaces, setw's whatever in line 44
(it doesn't happen automatically) The important thing is just to put a space between the items at this stage and make sure the data is being read correctly. I know it is, but you need to convince yourself
also i only want the ID Grade(%) & Letter Grade outputted. i think it looks so crazy becaue all 7 hw's midterms and final are on the output txt . but if i add CourseGradePercentage to the cout and output it doesnt calculate right :(
all that means is your equation is wrong. The file records are being read properly as far as I can see.
just make a dummy equation and add them all up. that way you can quickly check a number is not accidentally a string. Coursegrade was the reason I changed it arbitrarily to LetterGrade because it didn't make sense at the time.
ive been playing around with it and moving stuff but it just doesnt want to give me a percent (75.20 as an example) and all are F's . im sorry kemort i know you are trying to push me into the right direction. im trying though i promise