#include<iostream>
#include<string>
usingnamespace std;
void printArray(string ClassList[ ], int StudentSize);
int main()
{
//Declare variables
int numStudents;
//Have user determine size of array by entering the number of students in class
cout << "Enter the number of students in your class: ";
cin >> numStudents;
//declare array
string Roster[numStudents];
//Enter the names of each of your students
cout << "Enter the names of each of your students.\n";
for(int x = 0; x < numStudents; x +=1)
{
cin >> Roster [x];
}
//Display the Class list and number of students
printArray(Roster, numStudents);
return 0;
}
//Function Definition
void printArray(string ClassList[ ], int StudentSize)
{
for(int x = 0; x < StudentSize; x +=1)
{
cout << "The names of your students are: \n";
cout << ClassList [x] << endl;
}
cout << "You have " << StudentSize << "students. \n";
}