Checks to make sure that file is open before reading from it, otherwise displays a useful message.
Reads in all the grades. Determines the point value of the letter grade. A = 4.0, B = 3.0, C = 2.0, D = 1.0, F = 0.0.Closes the file.
Adds all points together and divides by 4.
Displays the grade point average to the screen.
can anyone explain to me how to write data to a file and outout it?
this is what i got and thats the only thing i unerstood about this program
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int main(int argc, char *argv[])
{
ifstream outputfile;
outputfile.open ("C:\\lettergrades.txt");
outputfile << lettergrade\n;
system("PAUSE");
return EXIT_SUCCESS;
}

New Topic/Question
Reply




MultiQuote





|