تبلیغات
برنامه نویسی با پاسکال - دریافت اطلاعات 100 دانشجو ، چاپ لیست مشروطین ، منظم نمودن اطلاعات قبول شدگان بر اساس فامیلی

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

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

حسین

جستجو

 

دریافت اطلاعات 100 دانشجو ، چاپ لیست مشروطین ، منظم نمودن اطلاعات قبول شدگان بر اساس فامیلی

جمعه 22 آذر 1387   12:46 ب.ظ


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

uses wincrt;

var
   info : array[1..100,1..2] of string[25];
   fa: array[1..100]of string[30];
   no : array[1..100,1..6] of integer;
   ave: array[1..10] of real;
   n,i,j,index,t : integer;
   an,min,temp: string[30];
   t1 : real;
begin
     writeln('Enter Number Of Student Which you want to add,Maximum is 100');
     readln(n);
     if n>100 then
        writeln('Number Is Greater than 100,program will work But in continue you have problem');
     writeln('Now Enter Information');
     for i:=1 to n do
         for j:=1 to 9 do
             begin
                  case j of
                       1:
                         begin
                              writeln('Enter First name of student ',i);
                              readln(info[i,1]);
                         end;
                       2:
                         begin
                              writeln('Enter Last name of student ',i);
                              readln(fa[i]);
                         end;
                       3:
                         begin
                              writeln('Enter Student No of student ',i);
                              readln(info[i,2]);
                         end;
                       4:
                         begin
                              writeln('Enter grade 1 of student ',i);
                              readln(no[i,1]);
                         end;
                       5:
                         begin
                              writeln('Enter unit of grad 1 of student ',i);
                              readln(no[i,2]);
                         end;
                       6:
                         begin
                              writeln('Enter grade 2 of student ',i);
                              readln(no[i,3]);
                         end;
                       7:
                         begin
                              writeln('Enter unit of grad 2 of student ',i);
                              readln(no[i,4]);
                         end;
                       8:
                         begin
                              writeln('Enter grade 3 of student ',i);
                              readln(no[i,5]);
                         end;
                       9:
                         begin
                              writeln('Enter unit of grad 3 of student ',i);
                              readln(no[i,6]);
                         end;
                  end;
             end;
     for i:= 1 to n do
         for j:= 1 to 6 do
             ave[i]:=(((no[i,1]*no[i,2])+(no[i,3]*no[i,4])+(no[i,5]*no[i,6]))/(no[i,2]+no[i,4]+no[i,6]));
     writeln('If You Want Liste Mashrootin Write mashroot');
     writeln('If You Want Liste Ghaboolin write ghabool');
     readln(an);
     if an='mashroot' then
        begin
             writeln('*********** Liste Mashrootin ************');
             for i:= 1 to n do
                 if (ave[i]<10) then
                    begin
                         writeln('*');
                         writeln('*   Full name : ',info[i,1],' ',fa[i]);
                         writeln('*   Student No : ',info[i,2]);
                         writeln('*   Average is : ',ave[i]:5:2);
                         writeln('*');
                         
                    end;
            
             writeln('*****************************************');
        end
     else if (an='ghabool') then
         begin
              for i:= 1 to n do
                  begin
                       min:= fa[i];
                       index:=i;
                       for j:= i+1 to n do

                           if fa[j]< min then
                              begin
                                   min:= fa[j];
                                   index:=j;
                              end;
                           fa[index]:=fa[i];
                           fa[i]:=min;
                           for j:= 1 to 2 do
                               begin
                                    temp:=info[i,j];
                                    info[i,j]:=info[index,j];
                                    info[index,j]:=temp;
                               end;
                           for j:=1 to 6 do
                               begin
                                    t:=no[i,j];
                                    no[i,j]:=no[index,j];
                                    no[index,j]:=t;
                               end;
                           t1:=ave[i];
                           ave[i]:=ave[index];
                           ave[index]:=t1;
                  end;
                writeln('********************************** Liste Ghaboolin ***********************');
                writeln('*                                                                        *');
                writeln('*Last name * First name * Student No * grade1 * grade2 * grad3 * average *');
                i:=1;
                for i:= i to n do
                    begin
                         if (ave[i]<10) then
                            i:=i+1;
            writeln('*',fa[i],' * ',info[i,1],' * ',info[i,2],' * ',no[i,1],'  * ',no[i,3],' * ',no[i,5],' * ',ave[i]:5:2,'*');
                    end;
                writeln('**************************************************************************');
         end;              
end.


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