االسلام عليكم ورحمة الله وبركاته
اول موضوعي هنا ساعدوني لاكسب ودكم وتكسبون ودي
//??C C?E??C?? ???? ?I??? ??? ???? ?C??E ?C?C?//
#include<iostream.h>
#include<iomanip.h>
#include<cstring>//??EEE ?????E?CE
class hatem
{
public:
int i;//?II ??II ??C? C???C?E
int r,ch,me,eda,t,pirce,dis;//?EU??CE IC?E EC?????
int id;//?EU??CE IC?E E??? C???CE
char nam[90];//?EU??CE IC?E E??? C???CE
char frind[90];//?EU??CE IC?E E??? C???CE?
char op[90];//?EU?? ???? C??C?? ?? CEIC? ???? ?? C??C??E
void setf(int);
int getf();
void setz(int);
int getz();
hatem()
{
cout<<"costructor\n";
}
~hatem()
{
cout<<"destructor\n";
}
private:
int x;
int y;
};
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
void hatem::setf(int a)
{
x=a;
}
void hatem::setz(int c)
{
y=c;
}
int hatem::getf()
{
return x;
}
int hatem::getz()
{
return y;
}
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
int f1(int y)
{
return y=y*y;
}//?????? EC????E
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
int f2(int *e)
{
return *e=*e**e;
}//?????? EC?????
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
int main()
{
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
hatem h;
h.setf(5);
h.setz(5*5);
cout<<h.getf()<<endl;
cout<<h.getz()<<endl;
cout<<"end get AND set \n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
cout<<"\n????????????????????????????????????????????????????????????????????????????????\n\n\n";
cout<<"\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
cout<<"\n\t\t''YOU ARE WELCOME IN GAZAN UNIVERSITY''\n ";//???E E???E?E
cout<<"\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n";
cout<<"\n";
cout<<"????????????????????????????????????????????????????????????????????????????????";
cout<<"TO VISIT THE LAIPRARY PRES 1\nTO VISIT THE RESTRUNT PRES 2\nTO VISIT ANY STUDENT PRES 3\nTO EXIT PRES 4\n";
cin>>h.i;
cout<<"\n******************\n";
char l[]="WELCOME IN THE LAIPRARY\nwe have 3 section in our laiprary\n1-islamic section\n2-history section\n3-since section\n";
char rest[]="WELCOME IN THE RESTRUNT\n";
char stu[]="WELCOME IN THE STUDENTS'S HOUSES\n";
char ex[]="THANKS FOR YOUR VISIT\n";
char rng[]="SORRY THIS NUMBER IS ROWNG\n";
if(h.i==1)
{
cout<<l;
cout<<"????????????????????????????????????????????????????????????????????????????????";
}
if(h.i==4)
{
cout<<"\nENMTER YOUR OPYNYAN IN JAZAN UNIVERSITY\n";
cin>>h.op;
cout<<ex;
cout<<"????????????????????????????????????????????????????????????????????????????????";
}
if(h.i>=5)
{
cout<<"\a";
cout<<rng;
cout<<"????????????????????????????????????????????????????????????????????????????????";
}
if(h.i==2)
{
cout<<rest;
cout<<"\n????????????????????????????????????????????????????????????????????????????????\n\n\n";
cout<<"\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
cout<<"\n\t\t\t ''YOU ARE WELCOME IN THE RESTRUNT''\n ";
cout<<"\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n";
cout<<"\n";
cout<<"????????????????????????????????????????????????????????????????????????????????";
cout<<"\n--------------------------------------------------------------------------------\n";
cout<<"\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
cout<<"\n _____________________________";
cout<<"\n how many of rice you want ";
cin>>h.r;
cout<<" | |";
//cout<<"\a";
cout<<" | |";
cout<<"\n how many of chken you want ";
cin>>h.ch;
cout<<" | |";
//cout<<"\a";
cout<<"\n _____________________________";
cout<<"\n how many of meat you want ";
cin>>h.me;
cout<<" | |";
//cout<<"\a";
cout<<"\n _____________________________";
cout<<"\n how many of edam you want ";
cin>>h.eda;
cout<<" | |";
//cout<<"\a";
cout<<"\n _____________________________";
cout<<"\n how many of tae you want ";
cin>>h.t;
cout<<" | |";
cout<<"\a";
cout<<"\n _____________________________";
h.pirce=(2*h.r)+(20*h.ch)+(30*h.me)+(5*h.eda)+(1*h.t);
h.dis=h.pirce-10;
cout<<"\n\n\t\t\t\t the pirce is:"<<h.pirce;
cout<<"\n\n\t\t\t\t after discawin is:"<<h.dis;
cout<<"\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n";
}
if(h.i==3)
{
cout<<stu;
cout<<" enter your id ";cin>>h.id;
cout<<" enter your name ";cin>>h.nam;
cout<<" enter name of your frind ";cin>>h.frind;
cout<<"\n?????????????????????????\n";
cout<<"\nmy id is:"<<h.id<<endl;
cout<<"_____________________________";
cout<<"\nmy name is:"<<h.nam<<endl;
cout<<"_____________________________";
cout<<"\nmy frind's name is:"<<h.frind<<endl;
cout<<"_____________________________\n";
cout<<"welcome\n";
cout<<"_____________________________";
cout<<"\n //end class \n";
cout<<"\n?????????????????????????????????????????????????????????????????????????????\n";
}
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
int const x=9;//?C ??E??? EU????
int const *px=&x;//?C ??E??? EU????
cout<<x<<endl;
cout<<*px;
cout<<"\n //end const \n";
cout<<"\n?????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
int a=90;
int *pa;
pa=&a;
cout<<a<<endl;//a ???E
cout<<&a<<endl;//a ???C?
cout<<*pa<<endl;//a ??O?
cout<<&*pa<<endl;//a ???C? ??O?
cout<<"\n //end pointer \n";
cout<<"\n?????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
char ar[]="you are welcom in jazan university";
cout<<"size of array="<<sizeof ar;//IC?E E??? C????
cout<<"\n //end sizeof \n";
cout<<"\n?????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
char s1[]="welcome";
char s2[]="in jazan university";
char s3[]=" ";
cout<<"s1:"<<s1<<endl<<"s2:"<<s2<<endl<<endl;
cout<<"after cat(s1,s2):\n";
strcat(s1,s2);//?I??2C??1
cout<<"s1:"<<s1<<endl<<"s2:"<<s2<<endl<<endl;
cout<<"after cat(s3,s1,4):\n";
strncat(s3,s1,4);//?I??2C??1???? ?? 3C?E?E ???? ??1
cout<<"s1:"<<s1<<endl<<"s3:"<<s3<<endl<<endl;
cout<<"\n //end cat \n";
cout<<"\n??????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
char *c1="ha";
char *c2="t";
char *c3="emm";
cout<<"c1="<<c1<<endl<<"c2="<<c2<<endl<<"c3="<<c3<<endl<<setw(6)<<"strcmp(c1,c2)="<<strcmp(c1,c2)<<setw(6)<<endl<<"strcmp(c1,c3)="<<strcmp(c1,c3)<<setw(2)<<endl<<"strcmp(c3,c1)="<<strcmp(c3,c1)<<endl;
cout<<setw(6)<<"strncmp(c1,c3,2)="<<strncmp(c1,c3,2)<<endl<<setw(6)<<"strncmp(c1,c3,3)="<<strncmp(c1,c3,3)<<endl<<setw(6)<<"strncmp(c3,c1,3)="<<strncmp(c3,c1,3)<<endl;
cout<<"\n //end comper \n";//??C?? ?II C????? E?? C????
cout<<"\n??????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
char v[]="HATEM MADKHALY";
char y[20];
char z[15];
strcpy(y,v);//yC?? v???I C??EC?E ??
cout<<"v:"<<v<<endl<<"y:"<<y<<'\n';
strncpy(z,v,5);//zC?? v???I I??E ???? ??
z[5]='\0';
cout<<" array z:"<<z<<endl;
cout<<"\n //end copy \n";
cout<<"\n?????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
char *st1="nice to meet you";
char *st2="I am also";
char *st3="good by";
cout<<"\""<<st1<<"\"is="<<strlen(st1)<<endl<<st2<<"\"is="<<strlen(st2)<<endl<<st3<<"\"is="<<strlen(st3)<<endl;
//???E ??? C????E
cout<<"\n //end len \n";
cout<<"\n??????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
char sent[]="you are welcom in my restrunt";
char *tp;
cout<<"the sentes is:"<<sent<<"bgn\n\n"<<endl;
cout<<"\n----------------------------------------\n";
tp=strtok(sent," ");
while(tp !=NULL)
{
cout<<tp<<'\n';
tp=strtok(NULL," ");
}
cout<<"\n----------------------------------------\n";
cout<<"after tok sentes ="<<sent<<endl;
cout<<"\n //end tok \n";
//???? C????E C?? ???CE ??????
cout<<"\n??????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
int b=5;
cout<<b<<endl;
cout<<f1(B)<<endl;
cout<<"\n //end by value \n";
cout<<"\n??????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
int bb=5;
cout<<bb<<endl;
cout<<f2(&bb)<<endl;
cout<<bb<<endl;
cout<<"\n //end by ref \n";
cout<<"\n??????????????????????????????????????????????????????????????????????????????\n";
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
return 0;
}
//\/\/\/\/\/\/\/\/\/\/\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/