تبلیغات
برنامه نویسی با پاسکال - سیستم ثبت اطلاعات دانشجویان:ثبت:حذف:مرتب سازی به در خواست دوستان

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

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

حسین

جستجو

 

سیستم ثبت اطلاعات دانشجویان:ثبت:حذف:مرتب سازی به در خواست دوستان

جمعه 6 دی 1387   12:11 ب.ظ


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

{Student Information
Programming By Hussein Tajarenezhad
Tajarenezhad@gmail.com}

uses wincrt;
type
    StudentInformation = record
                       firstname,lastname : string[20];
                       studentno : longint;
                       average : real;
    end;
    students = array[1..100] of StudentInformation;
var
   stud : students;
   sc,m,s,i,j : integer;

procedure starting;
          begin
               writeln('* W E L C O M E  T O  S T U D E N T  I N F O R M A T I O N *');
               writeln;
               Writeln('What You Want To Do?');
               writeln;
               writeln('  * Add Student                          : 01');
               writeln('  * Find Student By Last name            : 02');
               writeln('  * Find Student By Student.No           : 03');
               writeln('  * View All Student                     : 04');
               writeln('  * Delete Student                       : 05');
               writeln('  * For Sorting Student By Last Name     : 06');
               writeln('  * For Sorting Student Student.No       : 07');
               writeln('  * Edit Student Infomation              : 08');
               writeln;
               writeln('Enter Service Code :');
               readln(sc);
               clrscr;
          end;

procedure scan;
          var
             n,i,j : integer;
           
          begin
              
               writeln('                    * A D D  S T U D E N T  S Y S T E M *');
               writeln;

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

                          if n > 100 then
                             begin
                                  writeln('You can only Enter 100 Student!');
                                  m:=m-n;
                     end;
               for i:= 1 to n do
                   begin
                        for j:= 1 to 4 do
                            begin
                                 case j of
                                      4:
                                        begin
                                             writeln('Enter Student Average :');
                                             readln(stud[i].average);
                                            
                                        end;
                                      2:
                                        begin
                                             writeln('Enter Last name of Student :');
                                             readln(stud[i].lastname);
                                        end;
                                      1:
                                        begin
                                             writeln('Enter First name of Student :');
                                             readln(stud[i].firstname);
                                        end;
                                      3:
                                        begin
                                             writeln('Enter Student.No :');
                                             readln(stud[i].Studentno);
                                        end;
                                     
                                 end;
                            end;
                        writeln;
                        writeln('Entering Data Compelited');
                        writeln;
                        write('* ',stud[i].firstname,' ',stud[i].lastname,' ',stud[i].studentno);
                        writeln(' Student Sucssecfuly Added');
                        writeln;
                        if i<>n then
                           writeln('Now Enter Data of Student ',i+1);
                   end;
                   Writeln('Entering Data for ',n,' Student Compelited');
                   writeln;
                   writeln('For Continue Press Enter');
                   readln;
                   clrscr;
                   starting;
                  
               end;
          end;{End of procedure scan}

procedure searchname;
          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  L A S T  N A M E *');
               writeln;
               writeln('Enter last name which you want to search');
               readln(l);
               flag:= 0;
               sni:=1;
               while (sni<100) and (flag=0) do
                     begin
                          if l=stud[sni].lastname then
                             begin
                                  writeln('Data Found!');
                                  writeln;
                                  writeln('*******************************************************************************');
                                  writeln('*');
                                  writeln('* Full name     : ',stud[sni].firstname,' ',stud[sni].lastname);
                                  writeln('* Student.No    : ',stud[sni].studentno);
                                  writeln('* Average       : ',stud[sni].average:5:2);
                                  writeln('*');
                                  writeln('*******************************************************************************');
                                  flag:= 1;
                             end;
                          inc(sni);
                     end;
               if flag=0 then
                  Writeln('Student Not Found');
               writeln;
               writeln('For Continue Press Enter');
               readln;
               clrscr;
               starting;
          end;{End of procedure search name}

برای دریافت ادامه سورس کد ادامه مطلب را ببینید

procedure searchcode;
          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  C U S T O M E R  C O D E *');
               writeln;
               writeln('Enter Student.No which you want to search');
               readln(cc);
               flag1:= 0;
               sci:=1;
               while (sci<100) and (flag1=0) do
                     begin
                          if (cc=stud[sci].studentno) then
                             begin
                                  writeln('Data Found!');
                                  writeln('*******************************************************************************');
                                  writeln('*');
                                  writeln('* Full name     : ',stud[sci].firstname,' ',stud[sci].lastname);
                                  writeln('* Student.No    : ',stud[sci].studentno);
                                  writeln('* Average       : ',stud[sci].average:5:2);
                                  writeln('*');
                                  writeln('*******************************************************************************');
                                  flag1:= 1;
                             end;
                          inc(sci);
                     end;
               if flag1=0 then
                  Writeln('Student Not Found');
               writeln;
               writeln('For Continue Press Enter');
               readln;
               clrscr;
               starting;
          end;{End of procedure search code}

 

procedure sortname;
          var
             index : integer;
             min   : string;
             temp  : StudentInformation;
          begin
          writeln('        * S O R T I N G  S T U D E N T   S Y S T E M  B Y  L A S T  N A M E *');
          writeln;
          for i:= 1 to m do
                  begin
                       min:= stud[i].lastname;
                       index:=i;
                       for j:= i+1 to m do

                           if stud[j].lastname< min then
                              begin
                                   min:= stud[j].lastname;
                                   index:=j;
                              end;
                           temp:=stud[index];
                           stud[index]:=stud[i];
                           stud[i]:=temp;
                  end;
                  writeln('Students sorted By Last Name');
                  writeln('For view sorted data in first page enter show service code');
                  writeln;
                  writeln('For Continue Press Enter');
                  readln;
                  clrscr;
                  starting;
                  
          end;{End Of procedure Sorting Data By Student Last Name}

procedure sortcode;
          var
             index : integer;
             min   : longint;
             temp  : StudentInformation;
          begin
          writeln('     * S O R T I N G  S T U D E N T  S Y S T E M  B Y  C U S T O M E R  C O D E *');
          writeln;
          for i:= 1 to m do
                  begin
                       min:= stud[i].Studentno;
                       index:=i;
                       for j:= i+1 to m do

                           if stud[j].Studentno< min then
                              begin
                                   min:= stud[j].Studentno;
                                   index:=j;
                              end;
                           temp:=stud[index];
                           stud[index]:=stud[i];
                           stud[i]:=temp;
                  end;
                 
                  writeln('Students sorted By Student.No');
                  writeln('For view sorted data in first page enter show service code');
                  writeln;
                  writeln('For Continue Press Enter');
                  readln;
                  clrscr;
                  starting;
          end;{End Of procedure Sorting Data By Student Code}

procedure show;

          begin
               writeln('        * V I E W  A L L   S T U D E N T   S Y S T E M *');
               writeln;
               writeln('*******************************************************************************');
               writeln('*   Full Name   *  Student.No  *  Average                                     *');
               writeln('*******************************************************************************');
               for i:= 1 to m do
                   begin
                        write('  ',stud[i].firstname,' ',stud[i].lastname);
                        write(' ':5,stud[i].Studentno);
                        writeln(' ':5,stud[i].average);
                   end;
               writeln('*******************************************************************************');
              
                   writeln;
                   writeln('For Continue Press Enter');
                   readln;
                   clrscr;
                   starting;
          end;{End of procedure show all Students}


procedure delete;
          var
             id : longint;
             flag : integer;
             ans : integer;
            
          begin
               writeln('             * D E L E T I N G  S T U D E N T  S Y S T E M *');
               writeln;
               writeln('Enter Student.No of Student which you want to remove :');
               readln(id);
               flag:= 0;
               i:=1;
               while (i<100) and (flag=0) do
                     begin
                          if id=stud[i].Studentno then
                             begin
                                  writeln('You Select Student with below information!');
                                  writeln;
                                  writeln('*************************************************');
                                  writeln('*');
                                  writeln('* Full name      : ',stud[i].firstname,' ',stud[i].lastname);
                                  writeln('* Student.No     : ',stud[i].Studentno);
                                  writeln('* Average        : ',stud[i].average);
                                  writeln('*');
                                  writeln('*************************************************');
                                  flag:=1;
                                  writeln;
                                  writeln;
                                  writeln('Are You sure to remove ',stud[i].firstname,' ',stud[i].lastname,' ?');
                                  writeln('If you are agree press 0 key');
                                  readln(ans);
                                  if ans=0 then
                                     begin
                                          for j:= i to m do
                                              begin
                                                   stud[j]:=stud[j+1];
                                                  
                                              end;
                                          m:=m-1;
                                          writeln;
                                          writeln('Student sucssecfully removed!');
                                          writeln;
                                          writeln('For Continue Press Enter');
                                          readln;
                                          clrscr;
                                          starting;
                                     end
                                  else
                                      begin
                                           writeln;
                                           writeln('Removing Canceled!');
                                           writeln;
                                           writeln('For Continue Press Enter');
                                           readln;
                                           clrscr;
                                           starting;
                                      end;
                             end;
                          inc(i);
                     end;
               if flag=0 then
                  begin
                       Writeln('Student Not Found');
                       writeln;
                       writeln('For Continue Press Enter');
                       readln;
                       clrscr;
                       starting;
                  end;
          end;{End Of Procedure Delete}


procedure edit;
          var
             id : longint;
             flag : integer;
             ans : integer;
            

          begin
               writeln('       * E D I T I N G  S T U D E N T  I N F O R M A T I O N  S Y S T E M *');
               writeln;
               writeln('Enter Student.No of Student which you want to change information''s :');
               read(id);
               flag:= 0;
               i:=1;
               while (i<100) and (flag=0) do
                     begin
                          if id=stud[i].Studentno then
                             begin
                                  writeln('You Select Student with below information!');
                                  writeln;
                                  writeln('*************************************************');
                                  writeln('*');
                                  writeln('* Full name      : ',stud[i].firstname,' ',stud[i].lastname);
                                  writeln('* Student.No     : ',stud[i].Studentno);
                                  writeln('* Average        : ',stud[i].average);
                                  writeln('*');
                                  writeln('*************************************************');
                                  flag:= 1;
                                  writeln;
                                  writeln;
                                 
                                  writeln('************************');
                                  writeln('*                      *');
                                  writeln('* First Name     :  1  *');
                                  writeln('* Last Name      :  2  *');
                                  writeln('* Student.No     :  3  *');
                                  writeln('* Average        :  4  *');
                                  writeln('*                      *');
                                  writeln('************************');
                                  writeln;
                                  writeln('Enter Code of Each Information :');
                                  readln(ans);
                                  case ans of
                                       1:
                                         begin
                                              writeln('Enter New First name of Student :');
                                              readln(stud[i].firstname);
                                              writeln('First name Changed!');


                                         end;
                                       2:
                                         begin
                                              writeln('Enter New Last name of Student :');
                                              readln(stud[i].lastname);
                                              writeln('Last name Changed!');

                                              
                                         end;
                                       3:
                                         begin
                                              writeln('Enter New Student.No Student :');
                                              readln(stud[i].Studentno);
                                              writeln('Student.No Changed!');


                                         end;
                                       4:
                                         begin
                                              writeln('Enter New Average of Student :');
                                              readln(stud[i].average);
                                              writeln('Average Changed!');


                                         end
                                      
                                       else
                                           begin
                                                writeln('With Upper Code We dont Have information');
                                                writeln;
                                                writeln('For Continue Press Enter');
                                                readln;
                                                clrscr;
                                                starting;
                                           end;         
                                  end;
                            
                             end;
                          inc(i);
                     end;
               if flag=0 then
                  begin
                       Writeln('Student Not Found');
                       writeln;
                       writeln('For Continue Press Enter');
                       readln;
                       clrscr;
                       starting;
                  end
               else
                   begin
                       writeln;
                       writeln('For Continue Press Enter');
                       readln;
                       clrscr;
                       starting;
                   end;
          end;{End OF Perucedure Edit}

procedure afterstarting;
          begin
               case sc of
                    01:
                       scan;
                    02:
                       searchname;
                    03:
                       searchcode;    
                    04:
                       show;
                    05:
                       delete;
                    06:
                       sortname;
                    07:
                       sortcode;
                    08:
                       edit;
                   
               else
                   begin
                        writeln('* With Code: ',sc,' We Dont Have Service!!!');
                        starting;
                   end;
                   

               end;
          end;
begin
     starting;
     s:=1;
     while s=1 do
           afterstarting;
end.{End Of Main}

{Student Information
Programming By Hussein Tajarenezhad
Tajarenezhad@gmail.com}


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