Разработка программы для создания списка и обработки данных студентов, страница 5


                           +                                                         -

Чтение данных списка memory not enough

,Закрытие файла,КОНЕЦ
 


13.  Функциядобавления из файла

       void open_add_list (educational* &end, educational* &begin, char * name_file)

ifstream in_file(name_file)

,in_file,НАЧАЛО 


                                                          +                                                               -

                                                                                                                          

in_file >> str;
ed -> education ->street =strdup(str);
……………………………………


,           ed

,File not Find,i=0;i<count;i++
 


                           +                                                         -

Чтение данных списка memory not enough

,Закрытие файла,КОНЕЦ
 


14.  Функциядля обмена связями

      int swap_element(educational * ed1, educational * &end, educational * &begin)

НАЧАЛО,ed1&& ed2&&
end&&begin
 


                                                                  +                                                                  -

1 2
 

1
2
 


ed1==begin                                    +                                                   _

                                     

begin= ed2,ed2==end
 


                                   +                                                    -

end= ed1,w_next= ed2->next;
   w_previos= ed1->previos;
     ed1->next=w_next;
     ed2->previos=w_previos;
     ed1->previos= ed2;
     ed2->next= ed1;
 


ed1->next                                    +                                                   _

                                     

ed1->next->previos= ed1,ed2->previos
 


                                   +                                                         -

ed2->previos->next= ed2
КОНЕЦ
 


15.  Функциясортировки

       void orend_of_street(educational * &end, educational * &begin)

НАЧАЛО,begin->next
!=end_orend
 


                                                                                                                          _

 


                                                                                       

                                                                                        +

current=begin,current->next
!=end_orend
 


                                                                                                                           -

 


                                                                                        +

(strcmp(current -> education ->street,current -> education ->street)>=0)
 


                                                             +                                                          -

current=current->next,swap_element
!current->next
 


                                                             +                                                            -

     

end_orend =end,end_orend =end_orend->previous
КОНЕЦ
 


16.  Функциявывода на экран

       void out_of_display(educational * begin)

начало,clrscr()
unemployed* work=begin
(work!=NULL),cout << work,work=work->next
cout << work
конец,work=work->next
 



17. Функция меню сортировки

       void menu_of_orending (educational * &begin, educational * &end)

начало,int inp1; char *inp2=new char [25];,cout << " 1 - City; " << endl; cout << " 2 – Street; " << endl;…. 
cout << " 6 - OUT LIST OF DISPLAY" << endl; cout << " 8 - EXIT TO GENERAL MENU" << endl;
,«Input:»

,cin >> inp2;
inp1=atoi(inp2);

,Inp1=1

,Inp1!=7

,orend_of_street(end,begin); clrscr();
cout << "List orending of  STREET!" << endl; 
wait_key();
,delete []inp2
конец
 



18.  ФункцииLICHNOE ZADANIE

int line_find_to_COMPETITION_and_NAME_all (educational* begin, double d,char* str1)

НАЧАЛО  ,work!=NULL
 


                                                                                                         -