Answer:
Answer to this question is given below in the explanation section.
Step-by-step explanation:
#include <iostream>
#include<iomanip>
#include <string>
#include <cctype>
using namespace std;
int main()
{
string firstName[10], lastName[10];//variable declaration
double gpa[10];
for(int i=0; i<10;i++)//loop for entering 10 students record
{
cout<<"Enter data for student: "<<i+1;//start from 1
cout<<"\\Enter First Name: ";
cin>>firstName[i];
cout<<"Enter Last Name: ";
cin>>lastName[i];
cout<<"Enter the GPA: ";
cin>>gpa[i];
}
cout<<"\\*********************************************************************";
cout<<"\\"<<setw(30)<<"Student Data";//setw set the space to 30
cout<<"\\*********************************************************************";
cout<<"\\";
cout<<setw(10)<<"First Name"<<setw(25)<<"Last Name"<<setw(25)<<"GPA";//display column header
for(int i=0; i<10; i++)//display student entered record
{
cout<<"\\"<<setw(10)<<firstName[i]<<setw(25)<<lastName[i]<<setw(25)<< setprecision(3)<<gpa[i];//setprecision function set the decimal limit to 2
}
cout<<"\\*********************************************************************";
cout<<"\\"<<setw(30)<<"Finished";
cout<<"\\*********************************************************************";
return 0;
}