Is it possible to put these two functions to some classes?
#include <iostream> #include <string> using namespace std; //Functions that assigns values to array "points" from user's input void ReadPoints(int points[5]) { for (int i = 0; i < 5; i++) { cin >> points[i]; } } //Function that converts points to different grades void PointsToGrade(char grade[], int points[]) { const char *dataGrades[] = {"A","B","C","D","E", "F"}; for (int i = 0; i < 5; i++) { if (points[i] > 90) { grade[i] = *dataGrades[0]; } else if (points[i] > 70 && points[i] < 90) { grade[i] = *dataGrades[1]; } else if (points[i] > 50 && points[i] < 70) { grade[i] = *dataGrades[2]; } else if (points[i] > 30 && points[i] < 50) { grade[i] = *dataGrades[3]; } else if (points[i] > 10 && points[i] < 30) { grade[i] = *dataGrades[4]; } else { grade[i] = *dataGrades[5]; } } } int main() { //Creating an array wich is gonna be filled by user's input int points[5]; //Calling the function ReadPoint there is sended array "points" as an argument and dispaying the values of array "points" filled by user ReadPoints(points); int i; for (i = 0; i < 5; i++) { cout << points[i] << "\t\t"; } // Creating an array "grade" wich will be filled by grades char grade[5]; PointsToGrade(grade, points); for (i = 0; i < 5; i++) { cout << grade[i] << "\t\t"; } cout << endl; system("pause"); return 0; }