السلام عليكم
لقد قمت بحل هذا السوال بعد ان فمت السوال من قبل اعضاء المنتدى
هذا هوا اسوال
Consider a student registration application used by the registrar's office.
The program keep track of students who are registrar for a given semester.
For each student registered,the program maintains the student's (name , address , phone number)
the number of classes in which the student is enrolled and the total credit hours.
The program also keeps track of the total number of registered students .
Define class variables of a STUDENT class that is suitable for this application.
وهذه هي ترجمة السوال
Consider a student registration application used by the registrar's office.
لنفرض برنامج تسجيل طلاب لدى مركز .
The program keep track of students who are registrar for a given semester.
البرنامج يقوم بحفظ الطلاب الذين قاموا بالتسجيل في سداسي .
For each student registered,the program maintains the student's (name , address , phone number)
لكل طالب يسجل يقوم البرنامج بحفظ إسمه و عنوانه و رقم هاتفه .
the number of classes in which the student is enrolled and the total credit hours.
البرنامج يقوم بحساب عدد الحصص الذي قام الطالب بتسجيل نفسه فيها مع حساب لعدد الساعات الكلي .
The program also keeps track of the total number of registered students.
البرنامج يقوم أيضا بحساب عدد الطلاب المسجلين .
Define class variables of a STUDENT class that is suitable for this application.
عرف كائن طالب يحتوي على المتغيرات اللازمة ليتوافق مع هذا البرنامج
وهذه الخطوه لم افهم اية المطلوب لذالك لم اكتبها في الكود
البرنامج يقوم بحساب عدد الحصص الذي قام الطالب بتسجيل نفسه فيها مع حساب لعدد الساعات الكلي .
The program also keeps track of the total number of registered students
وهذا الحل الذي انا حليتة ولكن ارجو التصحيح اريد اعرف اخطائي......
#include <cstdlib>
#include <iostream>
using namespace std;
class student{
char* mvName;
char* mvAddress;
int mvPhone;
static int mvTotal;
public:
student()
{mvName=" "; mvAddress=" ";mvPhone=000;}
student(char* a, char* b ,int p)
{mvName=a ; mvAddress=b ; mvPhone=p;}
~student(){delete mvName ,mvAddress;}
void setName(char* a)
{this->mvName=a;}
void setAddress(char* b)
{this->mvAddress=b;}
void setPhone(int p)
{mvPhone=p;}
void setTotal()
{++mvTotal;}
char* GetName()const{return mvName;}
char* GetAddress()const{return mvAddress;}
int GetPhone()const{return mvPhone;}
int GetTotal()const{return mvTotal;}
};
int student::mvTotal=0;
int main(int argc, char *argv[])
{
char* input=new char[20];
int size;
int p;
int i;
student *C=new student[size];
cout<<"Enter students numbers :";
cin>>size;
for( i=0;i<size;i++)
{cout<<"\n\tStudent "<<i+1<<endl;
cout<<"Enter Name :";
cin>>input;
C.setName(input);
cout<<"Enter Address :";
cin>>input;
C.setAddress(input);
cout<<"Enter Phone Number :";
cin>>p;
C.setPhone(p);
C.setTotal();
}
for( i=0;i<size;i++)
{
cout<<"\n\tstudent "<<i+1<<endl;
cout<<"Name : "<<C.GetName()<<endl;
cout<<"Address : "<<C.GetAddress()<<endl;
cout<<"Phone Number :"<<C.GetPhone()<<endl;
if(i+1==size)
cout<<"\n\nstudents total :"<<C.GetTotal()<<endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}