تبلیغات
برنامه نویسی با پاسکال - سیستم کتابخانه

ارائه سورس کد ها و پروژه های پاسکال تحت ویندوز!
صرفا جهت آموزش ، نه کپی برداری برای پروژه های دانشگاهی!

لطفا سورس کد های این وبلاگ را برای پرژه های دانشگاهی تون استفاده نکید ، واقعا هدف وبلاگ این نیست.
تمامی مسولیت کپی کردن و ارائه به استاد بر عهده شخص شماست نه نویسنده.

حسین

جستجو

 

سیستم کتابخانه

سه شنبه 3 دی 1387   01:36 ب.ظ


نوع مطلب : سورس کدهای پاسکال ،سورس کدها و پروژه های درخواستی ،

uses wincrt;{Programming By Hussein Tajarenezhad(Tajarenezhad@Gmail.com)}

type
    MemberInfo = array[1..100,1..3] of string[30];{First name,Last Name ,Books}
    Bookinfo = array[1..500,1..3] of string[20];{Book name ,Author name ,Book code,}
    MemberCode = array[1..100] of integer;{Member Code}

var
   mi : memberinfo;
   bi : bookinfo;
   mc : membercode;
   sc,i,j,mm,mb : integer;
procedure starting;
          begin
               writeln('                * L I B R A R Y  S Y S T E M *');
               writeln;
               Writeln(' What You Want To Do?');
               writeln;
               writeln('* Add Member            : 01');
               writeln('* Add Book              : 02');
               writeln('* Find Member           : 03');
               writeln('* View All Member       : 04');
               writeln('* View All Book         : 05');
               writeln('* Find Book             : 06');
              
               writeln;
               writeln('Enter Service Code :');
               readln(sc);
               clrscr;
              

          end;
procedure scanmember;
        
          var
             n,i,j : integer;
             k : char;
          begin
              
               writeln('                    * A D D  M E M B E R  S Y S T E M *');
               writeln;

               while n > 100 do
                     begin
                          writeln('Enter Number of Member you want to add');
                          readln(n);
                          mm:=mm+n;
                         

                          if n > 100 then
                             begin
                                  writeln('You can only Enter 100 Member!');
                                  mm:=mm-n;
                     end;
               for i:= 1 to n do
                   begin
                        for j:= 1 to 3 do
                            begin
                                 case j of
                                     
                                       
                                      2:
                                        begin
                                             writeln('Enter Last name of Member :');
                                             readln(mi[i,2]);
                                        end;
                                      1:
                                        begin
                                             writeln('Enter First name of Member :');
                                             readln(mi[i,1]);
                                        end;
                                      3:
                                        begin
                                             writeln('Enter Member Code :');
                                             readln(mc[i]);
                                        end;
                                     
                                 end;
                            end;
                        writeln;
                        writeln('Entering Data Compelited');
                        writeln;
                        writeln('* ',mi[i,1],' ',mi[i,2],' ',' Accunt Sucssecfuly Created');
                        writeln;
                        if i<>n then
                           writeln('Now Enter Data of Member ',i+1);
                   end;
                   Writeln('Entering Data for ',n,' Member Completed');
                   writeln;
                   writeln('For Continue Press Enter');
                   readln;
                   clrscr;
                   starting;
                  
          end;{End of procedure scanmember}
end;

procedure scanbook;
          var
             n,i,j : integer;
             k : char;
          begin
              
               writeln('                    * A D D  B O O K  S Y S T E M *');
               writeln;

              
                   
                          writeln('Enter Number of Book you want to add');
                          readln(n);
                          mb:=mb+n;
                         

                          if n > 1000 then
                             begin
                                  writeln('You can only Enter 1000 Book!');
                                 
                   
               for i:= 1 to n do
                   begin
                        for j:= 1 to 3 do
                            begin
                                 case j of
                                     
                                       
                                      1:
                                        begin
                                             writeln('Enter Name of Book :');
                                             readln(bi[i,1]);
                                        end;
                                      2:
                                        begin
                                             writeln('Enter Name of Book Author :');
                                             readln(bi[i,2]);
                                        end;
                                      3:
                                        begin
                                             writeln('Enter Book Code :');
                                             readln(bi[i,3]);
                                        end;
                                     
                                 end;
                            end;
                        writeln;
                        writeln('Entering Data Compelited');
                        writeln;
                        writeln('* ',bi[i,1],' ',bi[i,2],' Book Sucssecfuly Added');
                        writeln;
                        if i<>n then
                           writeln('Now Enter Data of Book ',i+1);
                   end;
                   Writeln('Entering Data for ',n,' Book Completed');
                   writeln;
                   writeln('For Continue Press Enter');
                   readln;
                   clrscr;
                   starting;
                  
          end;{End of procedure scanbook}
end;

procedure findmember;
          var
             cc : longint;
             flag1,sci : integer;
          begin
               writeln('        * S E A R C H I N G  S Y S T E M : B Y  M E M B E R  C O D E *');
               writeln;
               writeln('Enter Member Code which you want to search');
               readln(cc);
               flag1:= 0;
               sci:=1;
               while (sci<100) and (flag1=0) do
                     begin
                          if (cc=mc[sci]) then
                             begin
                                  writeln('Data Found!');
                                  writeln('*******************************************************************************');
                                  writeln('*');
                                  writeln('* Full name       : ',mi[sci,1],' ',mi[sci,2]);
                                  writeln('* Member  Code    : ',mc[sci]);
                                  writeln('* ');
                                  writeln('* Book''s         : ',mi[sci,3]);
                                  writeln('* ');
                                  writeln('*');
                                  writeln('*******************************************************************************');
                                  flag1:= 1;
                             end;
                          inc(sci);
                     end;
               if flag1=0 then
                  Writeln('Member Not Found');
               writeln;
               writeln('For Continue Press Enter');
               readln;
               clrscr;
               starting;
          end;{End of procedure search code}

procedure findbook;
          var
             l : string[30];
             flag,sni : integer;
            
          begin
               writeln('           * S E A R C H I N G  S Y S T E M : B Y  B O O K  N A M E *');
               writeln;
               writeln('Enter book name which you want to search');
               readln(l);
               flag:= 0;
               sni:=1;
               while (sni<100) and (flag=0) do
                     begin
                          if l=bi[sni,1] then
                             begin
                                  writeln('Data Found!');
                                  writeln;
                                  writeln('*******************************************************************************');
                                  writeln('*');
                                  writeln('* Book name     : ',bi[sni,1]);
                                  writeln('* Book Code     : ',bi[sni,3]);
                                  writeln('* Author        : ',bi[sni,2]);
                                  writeln('* ');
                                  writeln('* ');
                                  writeln('*');
                                  writeln('*******************************************************************************');
                                  flag:= 1;
                             end;
                          inc(sni);
                     end;
               if flag=0 then
                  Writeln('Book Not Found');
               writeln;
               writeln('For Continue Press Enter');
               readln;
               clrscr;
               starting;
          end;{End of procedure search book name}

procedure showallmember;
          begin
               writeln('        * V I E W  A L L  M E M B E R  A C C U N T  S Y S T E M *');
               writeln;
               writeln('*******************************************************************************');
               writeln('*   Full Name     *   Member Code    *    Books    *                          *');
               writeln('*******************************************************************************');
               for i:= 1 to mm do
                   begin
                        write('  ',mi[i,1],' ',mi[i,2]);
                        write(' ':5,mc[i]);
                        write(' ':5,mi[i,3]);
                       
                       
                   end;
               writeln('*******************************************************************************');
              
                   writeln;
                   writeln('For Continue Press Enter');
                   readln;
                   clrscr;
                   starting;
          end;{End of procedure show member}

procedure showallbook;
          begin
               writeln('        * V I E W  A L L  B O O K  S Y S T E M *');
               writeln;
               writeln('*******************************************************************************');
               writeln('*   Book Name     *   Author Name    *    Book Code    *                      *');
               writeln('*******************************************************************************');
               for i:= 1 to mb do
                   begin
                        write('  ',bi[i,1]);
                        write(' ':5,bi[i,2]);
                        write(' ':5,bi[i,3]);
                       
                       
                   end;
               writeln('*******************************************************************************');
              
                   writeln;
                   writeln('For Continue Press Enter');
                   readln;
                   clrscr;
                   starting;
          end;{End of procedure show book}

procedure afterstarting;
          begin
               case sc of
                    01:
                       scanmember;
                    02:
                       scanbook;
                    03:
                       findmember;    
                    04:
                       showallmember;
                    05:
                       showallbook;
                    06:
                       findbook;
                   
               else
                   begin
                        writeln('* With Code: ',sc,' We Dont Have Service!!!');
                        starting;
                   end;
                   

               end;
          end;


begin
     starting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
     afterstarting;
end.
{Programming By Hussein Tajarenezhad(Tajarenezhad@Gmail.com)}


نوشته شده توسط : حسین