# data[].attributes.body
with error handler for input number (gpa) and

filter the gpa value between 0.0 and 4.0

# data[].attributes.attachment_link.readable_text
//Lecture-11, slide-24
#include <iostream>
using namespace std;
struct STUDDATA
{
	char id[15];
	char name[50];
	float gradePoint;
};

int main( )
{    
     struct STUDDATA studBITG1113[3];
	for(int i = 0; i < 3; i++) //entry data
	{
		cout << "Please enter your id: ";
		cin.getline (studBITG1113[i].id, 15);
		cout << "\nPlease enter your name: ";
		cin.getline(studBITG1113[i].name,50);
		bool status;
		do
		{
			cout << "\nPlease enter your gradePoint: ";
			status = cin >> studBITG1113[i].gradePoint;
			if (!status)
				cin.clear();
			cin.ignore(100, '\n');
		} while (
					(!status) 
					|| 
					(studBITG1113[i].gradePoint < 0.0 
					|| studBITG1113[i].gradePoint > 4.0 )
				);
	}
	 
	for(int i = 0; i<3; i++) //display data
	{
		cout << "\nYour id is : " << studBITG1113[i].id;
		cout << "\nYour name is : " << studBITG1113[i].name;
		cout << "\nYour grade point is : " << studBITG1113[i].gradePoint;
		cout << endl;
	 
		if(studBITG1113[i].gradePoint > 3.5)
			cout << "\n Excellent! \n\n";
	}	
	
	return 0;
}

# data[].attributes.body
with error handler for input number (gpa).

# data[].attributes.attachment_link.readable_text
//Lecture-11, slide-24
#include <iostream>
using namespace std;
struct STUDDATA
{
	char id[15];
	char name[50];
	float gradePoint;
};

int main( )
{    
     struct STUDDATA studBITG1113[3];
	for(int i = 0; i < 3; i++) //entry data
	{
		cout << "Please enter your id: ";
		cin.getline (studBITG1113[i].id, 15);
		cout << "\nPlease enter your name: ";
		cin.getline(studBITG1113[i].name,50);
		bool status;
		do
		{
			cout << "\nPlease enter your gradePoint: ";
			status = cin >> studBITG1113[i].gradePoint;
			if (!status)
				cin.clear();
			cin.ignore(100, '\n');
		} while (!status);
	}
	 
	for(int i = 0; i<3; i++) //display data
	{
		cout << "\nYour id is : " << studBITG1113[i].id;
		cout << "\nYour name is : " << studBITG1113[i].name;
		cout << "\nYour grade point is : " << studBITG1113[i].gradePoint;
		cout << endl;
	 
		if(studBITG1113[i].gradePoint > 3.5)
			cout << "\n Excellent! \n\n";
	}	
	
	return 0;
}

# data[].attributes.body
Information for more than one student.

Array of student.

# data[].attributes.attachment_link.readable_text
//Lecture-11, slide-24
#include <iostream>
using namespace std;
struct STUDDATA
{
	char id[15];
	char name[50];
	float gradePoint;
};

int main( )
{    
     struct STUDDATA studBITG1113[3];
	for(int i = 0; i < 3; i++) //entry data
	{
		cout << "Please enter your id: ";
		cin.getline (studBITG1113[i].id, 15);
		cout << "\nPlease enter your name: ";
		cin.getline(studBITG1113[i].name,50);
		cout << "\nPlease enter your gradePoint: ";
		cin >> studBITG1113[i].gradePoint;
		cin.ignore(100, '\n');
		
	}
	 
	for(int i = 0; i<3; i++) //display data
	{
		cout << "\nYour id is : " << studBITG1113[i].id;
		cout << "\nYour name is : " << studBITG1113[i].name;
		cout << "\nYour grade point is : " << studBITG1113[i].gradePoint;
		cout << endl;
	 
		if(studBITG1113[i].gradePoint > 3.5)
			cout << "\n Excellent! \n\n";
	}	
	
	return 0;
}

# data[].attributes.body
information for one student.

# data[].attributes.attachment_link.readable_text
//Lecture-11, slide-24
#include <iostream>
using namespace std;
struct STUDDATA
{
	char id[15];
	char name[50];
	float gradePoint;
};

int main( )
{    
     struct STUDDATA studBITG1113;
 
     cout << "Please enter your id: ";
     cin.getline (studBITG1113.id, 15);
     cout << "\nPlease enter your name: ";
     cin.getline(studBITG1113.name,50);
     cout << "\nPlease enter your gradePoint: ";
     cin >> studBITG1113.gradePoint;
     cout << "\nYour id is : " << studBITG1113.id;
     cout << "\nYour name is : " << studBITG1113.name;
     cout << "\nYour grade point is : " << studBITG1113.gradePoint;
	 cout << endl;
	 
     if(studBITG1113.gradePoint > 3.5)
		cout << "\n Excellent! \n\n";
	return 0;
}
