Well people... I already know that c++ is not what I want to do in the future, but I do have to pass this class. That said, I need help with this array. I understand how they work, but my instructor wants us to use them in a function!!!!! I have tried for hours to maker it work but it will not process properly in main. I am trying to establish a dynamic array in which a person wants to input the number of students the user needs to input grades for. Here is what I have:
#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
void getStudentCount(int students);
void getExamScores(int score);
void getLabScores(int labArray);
void calculatePointGrades(int );
void calculateLetterGrades(int);
void showGradeData(int);
int main()
{
int increment,
score,
students;
getStudentCount(students);
for(increment = 0; increment < students; increment++)
{
cout << stuArray[increment] << endl;
}
getExamScores(score);
// if(gradeAvg >= 90)
// cout<< "A";
// else if (gradeAvg >= 80)
// cout<< "B";
// else if (gradeAvg >= 70)
// cout<< "C";
// else if (gradeAvg >= 60)
// cout<< "D";
// else
// cout<< "F";
cin.ignore(2);
return 0;
}
int getStudentCount(int students)
{
int* stuArray;
cout << "Enter the amount of students you wish to process\n" << endl;
cin >> students;
stuArray = new int[students];
return stuArray;
}
void getExamScores(int score)
{
cout << "Please enter in the scores for your student's Exam\n:" << endl;
cin >> score;
}
Afterwords, I am supposed to input the grades for the amount of students and some more stuff. Can anyone help?