Use C++ Structure Data: the program uses dynamic allocation tocreate an array
of strings. It asks the user to enter a number and based on theentered number it
allocates the array size. Then based on that number it asks theuser 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 asyou
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
Solution
#include <iostream>
using namespace std;
int main()
{
int n;
cout<<“Enter number of students: “;
cin>>n;
string *names=new string[n];
double *grades=new double[n];
cout<<“Enter
OR
OR