Example #1
0
void main()
{  int i;
   string w;
	cout << "Lesson1:  Encapsulation - Scope Resolution"<< endl ;
	a.initialize ();
	b.initialize ();

	cout <<"Enter Student name : " ; getline(cin,w);	
	strcpy(a.name,w.c_str());
	if (a.name[0]=='\0')  // if the name is empty
		return;
	printf("Enter # of credits : " );	cin >>a.credits ; // scanf("%d", &a.credits );

	a.add_new_course("CS 3397",2);
	a.add_new_course("CS 2410",3);
	a.display_info();
	for (i=0 ; i<8 && a.crs[i].ID[0]; i++ )
		a.crs[i].display_info();
}