Question: Could someone write this for me in c++ with the following peramiters? This is most of it, just the some loops that need to be
Could someone write this for me in c++ with the following peramiters?

This is most of it, just the some loops that need to be done.
#include
#include
#include
using namespace std;
int main()
{
int numOfStudents = 0; // The number of test scores
string *namesPtr = nullptr; // To point to the names
// Get the number of students.
cout
cin >> numOfStudents;
// Validate the input.
while (numOfStudents
{
cout
cout
cin >> numOfStudents;
}
// Allocate an array to hold the names.
namesPtr = new string[numOfStudents];
// Populate the arrays.
for (int i = 0; i
{
// Get a name.
cout
cin >> *(namesPtr + i);
}
// Display the resulting data.
cout
cout
cout
cout
for (int j = 0; j
{
cout
cout
}
cout
// Free the dynamically-allocated memory.
delete [] namesPtr;
namesPtr = nullptr;
return 0;
}
The attached program (studentsGpa.cpp) uses dynamic allocation to create an array of strings. It asks the user to enter a number and based on the entered number it allocates the array size. Then based on that number it asks the user that many times to enter student's names. What you need to do: Add another array of doubles to store the gpa of each student as you enter them You need to display both the student's name and the gpa. . NOTE: must use pointer notation not array subscript Any submission that uses array subscript won't be graded
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
