نص السؤال باللغة الانجليزيه:
We eant to built a database of student in a given course, e.g. ITGN315 (assume the maximum number of students is 50) . the databaase should contain the following data for each student
Name
ID Number
Date of Birth
For this part of the project your program should do the following task
1- acquire the students data and put them into an appropriate data type
2- Add a new student to the database
3- Remove a student from the database
4- Display the student data
Hints
use an array of structure to store the students data
Implement a menu with which can select the task he wants to perform, the menu shall also offer an option allowing the user to exit from the program . You can implement the menu using the if/else statements or the switch statement
وانا اجبت على السؤال الاول
#include
# include
using std :: cout;
using std :: cin;
typedef struct{
int Day;
int Month;
int Year;
}Date;
typedef struct{
string Name;
int IDName;
int DB; //date of birth
}student;
using std ::string;
void main ()
{
Student TabStd[50] ;
int NbrStd ;
int IndLastElement ;
int Count ;
cout << " Enter the number of students " ;
cin >> NbrStd ;
Count = 0 ;
string St ;
while (Count < NbrStd )
{
cout << " n Enter ID of the student " ;
cin >> TabStd[Count].IDNumber ;
cout << "n Enter Student name " ;;
cin >> TabStd[Count].Name ;
//cin >> TabStd[Count].Name ;
cout << " n Enter Student's Birth Dat: Day Month
Year (example 23 3 1986) " ;
cin >> TabStd[Count].DB.Day >>TabStd[Count].DB.Month >>TabStd[Count].DB.Year ;
Count++ ;
IndLastElement++ ;
}
Count =0 ;
while (Count < NbrStd )
{
cout << endl <
<<" " << TabStd[Count].DB.Month <<" " <<
TabStd[Count].DB.Year ;
Count++ ;
}
}
واريد ان تساعدوني في الباقي
وشكرا