مرحبا اخواني
انه كتبت البرنامج تقريبا كله بس دالة traversal وهي الداله الاخيره مب متأكده منها لانها اكيد خطأ مب عارفه اصيدها شلون اكتبها
بس ابي احد يجيك لي هالداله وباقي الدوال لو ممكن ووقتي فقط لليوم وبكرا
وبعدين ابي اقلبه لclass
#include<iostream.h>
#define size 20
typedef struct{
long cpr;
char name;
float salary;
}employee;
employee list;
int count=0;
int isempty(int c)
{
return(c==0)
}
int isfull(int co)
{
return(co==size)
}
int set-insertpos(long pos, float data)
{
if(isfull())
cout<<"full count add\n";
return(0);
else
for(int i=0;i<count;i++)
{
if(pos=list.cpr)
list.salary=data;
return(1);
}
return(0);
}
int set-insertposfront(float data,long pos){
if(isfull()){
cout<<"full acount data\n";
return(0);
}
set-insertpos(0,data);
return(1);
}
int set-insertposback(float data)
{
if(isfull()){
cout<<"full acount data\n";
return(0);
}
list[count].salary=data;
count++;
return(1);
}
int set-deletpos(long pos)
{
if(isempty()||(pos<0||pos>=size))
return(1);
else{
count--;
for(int i=pos;i<count;i++)
{
list=list[i+1]
return(0);
}
}
int deletposfront(){
if(isempty())
count<<"it is empty\n";
return(0);
else
{
set-deletpos(0);
return(1);
}
int deletposback(){
if(isempty()){
count<<"it is empty\n";
return0;
}
else
count--;
return(0);
}
int printdata(long pos,float data)
{
if(isempty()){
cout<<"it is empty\n";
return(0);
}
else{
for(int i=0;i<count;i++)
if(pos==list.pos)
{
data=list.data;
return(1);
}
return(0);
}
ومشكورين
ساره