Hello, I am having trouble getting my values to line up correctly with the appropriate columns. Some help would be appreciated...
here is the code below:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name[10];
int id[10];
int sub1[10];
int sub2[10];
int sub3[10];
int sub4[10];
int i;
for(i=0;i<=9;i++)
{
cout<<"Please enter student's name: ";
cin>>name[i];
cout<<"Please enter student's ID number: ";
cin>>id[i];
cout<<"Please enter marks for sub 1: ";
cin>>sub1[i];
cout<<"Please enter marks for sub 2: ";
cin>>sub2[i];
cout<<"Please enter marks for sub 3: ";
cin>>sub3[i];
cout<<"Please enter marks for sub 4: ";
cin>>sub4[i];
}
cout << endl;
cout << "Name" << " " << "IDNo" << " " << "Sub1" << " " << "Sub2" << " " << "Sub3" << " " << "Sub4" << endl;
for(i=0;i<=9;i++)
{
cout << name[i] << " " << id[i] << " " << sub1[i] << " " << sub2[i] << " " << sub3[i] << " " << sub4[i] << endl;
}
return 0;
}