Hello,
New here and hope to stay. Anyways...

I have started back with C++ and wanted to see how much I remembered. So please tell me what I am doing wrong. I am on linux at the moment and could not remeber if you used <iostream> with windows or linux.

Also need explanations on what do, I believe one of the main problems with my code is I need to keep the variables in ( ).

Code:

#include <iostream>
#include <fstream> // open, read, and write files

//for time
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

using namespace std;

void writeGrade(int studentAverage, int letterGrade){
/*
Use the variable gradeAverage to determin the the grade was a A, B, C, D, or F. Then open of the person's file, and write the grade.
*/
findLetter();
ofstream gradeFile;
gradeFile.open ("grades.txt");
gradeFile << "Student: " << studentAverage << endl;
gradeFile << "Grade: " << letterGrade << endl;
gradeFile << "Average: " << studentAverage << endl << endl;
}

int theAverage(int totalAmount, int gradeNumber, int studentAverage){
/*
Here we will average all the numbers together inside of a for loop
*/
totalAmount / gradeNumber == studentAverage;
return studentAverage;
}

int findLetter(){
//take the number and find the letter it is == to
//then store that letter in letterGrade
if ( studentAverage > 95 ){
letterGrade == A;
}
if ( studentAverage > 85 ){
letterGrade == B;
}
if ( studentAverage > 80 ){
letterGrade == C;
}
if ( studentAverage > 75 ){
letterGrade == D;
}
if ( studentAverage < 69 ){
letterGrade == F;
}
return letterGrade;
}

void saveError(){
// save error in log.txt
nowTime(int theTime);
ofstream logFile;
logFile.open ("log.txt");
logFile << "Date: " << theTime << endl;
logFile << "Error: File does not exist or cannot be opened." << endl;
logFile << "Please create file, or create a new file." << endl << endl;
}

int nowTime(){

time_t now;
time(&now);

theTime = "%s", ctime(&now);

return theTime;
}

int main(){
//startup variables that we will use
char studentName[255];
int studentAverage;
int gradeNumber; // amount of student Averages
int totalAmount; //will hold all averages
int submitAmount; //amount submited during for loop session
char letterGrade; // will store the lettergrade before it is written to grades.txt
int theTime; // will hold the current time
bool canWe; // asks if we can continue


// find out who we will be grading
cout << "Hello user!" << endl;
cout << "This program lets you average the grade of your student and write there grade in a text file." << endl;
cout << "Who will be writting a grade for today?" << endl << "Name: ";
cin >> studentName >> endl;
cout << "Ok, we will be grading " << studentName << "today!" << endl;

// make a loop for finding out the average
for ( gradeNumber; canWe == true; gradeNumber++; ){
cout << "Please submit the next grade." << endl << "Grade: ";
cin >> submitAmount;
submitAmount + totalAmount = totalAmount;
cout << "Thank you, the grade has been added." << endl;
cout << "Would you like to add another grade or would you like to quite?" << endl;
cout << "Type 1 to contine or type 2 to quite and press <enter>." << endl << "1 or 0: "; // may need to be switched to true or false
cin >> canWe >> endl;
return totalAmount, gradeNumber;
}

theAverage();
writeGrade();


return 0;
}