Gönderi tarihi: 20 Mart , 2005 20 yıl pascalda lise 2lere yönelik not hesaplama uses crt; type st10 = string[10]; const ders:array[1..12] of string[10]=('Edebiyat','Din kültürü','Ingilizce', 'Milli güvenlik','Matematik','Fizik', 'Isletim sistemleri','Atelye', 'Programlama','Paket programlama', 'Isletme bilgisi','Geometri'); max=10; var isim : array[1..max] of string[20]; n : array[1..max,1..5,1..3]of byte; i,j,e : byte; tus : char; cizgi : string[80]; satir : byte; procedure cerceve(x1,x2,y1,y2:byte); var k : byte; 4 begin gotoxy(x1,y1);write(#201); for k:=x1+1 to x2-1 do write(#205); write(#187); for k:=y1+1 to y2-1 do begin gotoxy(x1,k);write(#186); gotoxy(x2,k);write(#186); end; gotoxy(x1,y2);write(#200); for k:=x1+1 to x2-1 do write(#205); write(#188); end; procedure ilkekran; begin clrscr; cerceve(1,1,80,24); cerceve(3,2,78,4); cerceve(3,5,20,20); cerceve(22,5,60,7); cerceve(22,8,60,23); cerceve(62,5,78,20); cerceve(3,21,20,23); cerceve(62,21,78,23); gotoxy(25,3);write('PROGRAMI HAZIRLAYAN : CIHAN BšYšKBUR€ '); end; procedure BilgiGirisi; begin clrscr; if e < max then begin e:=e+1; write(E,'. ™grenci Adi....:');readln(isim[E]); if isim[e]="then begin e:=e-1;exit; end; for j:=1 to 12 do begin write(Ders[j],'.1. Notu giriniz......:');readln(N[E,j,1]); write(Ders[j],'.2. Notu giriniz......:');readln(N[E,j,2]); write(Ders[j],'.3. Notu giriniz......:');readln(N[E,j,3]); writeln; end; end else begin gotoxy(20,10);write('Daha Fazla Bilgi Girilemez... '); tus:=readkey; end; end; function ort:real; begin ort:=(n[i,j,1]+n[i,j,2]+n[i,j,3])/3; end; function sonuc:st10; begin if ort<45 then sonuc:='KALDI' else sonuc:='GEÇTI'; end; procedure yaz;begin clrscr; writeln('(',i,') ™grenci Adi.....:',isim); writeln; writeln('Ders adi',' '0,'Not-1',' ' ,'Not-2',' ', 'Not-3',' ','ort',' ','sonuc'); writeln(cizgi); for j:=1 to 12 do begin gotoxy(1,j+4);write(Ders[j]); gotoxy(30,j+4);write(n[i,j,1]); gotoxy(40,j+4);write(n[i,j,2]); gotoxy(50,j+4);write(n[i,j,3]); gotoxy(60,j+4);write(ort:3:0); gotoxy(68,j+4);write(sonuc); end; end; procedure tumliste; begin for i:=1 to e do begin begin yaz; tus:=readkey; end; gotoxy(25,20);write('Listelenecek Kayitlar Bitti...'); tus:=readkey; end; end; procedure bilgiarama; var ara : string[20]; begin repeat clrscr; cerceve(20,9,60,11); gotoxy(22,10);write('Isim...:');readln(ara); if ara=' ' then exit; for i:=1 to e do begin yaz; gotoxy(10,20);write('Aradiginiz Bu mu ?[E/H]'); repeat tus:=upcase(readkey); until tus in ['E','H']; if tus='E' then exit; end; gotoxy(10,30);write('Aradiginiz Kayit Yok....'); tus:=readkey; until 1=2; end; procedure baslik; var k : byte; begin clrscr; write('Ogrenci Adi',"2); for k:=1 to 12 do write(Ders[k]); writeln(' ort '); writeln(cizgi); satir:=2; end; procedure Dersortalama; var Gnot : integer; Gn : byte; begin baslik; for i:=1 to E do begin satir:=satir+1; gotoxy(1,satir);write(isim); gnot:=0; for j:=1 to 12 do begin Gn:=round(ort); gotoxy(15+j*10,satir);write(Gn:3); gnot:=Gnot+Gn; end; gotoxy(75,satir);write(Gnot/5:0); if satir=20 then begin gotoxy(20,25); write('Diger Sayfa i‡inçBir Tusa Basiniz..'); tus:=Readkey; baslik; end; end; end; procedure Baslik2; begin clrscr; write('Ogrenci Adi..',"2); writeln('Genel Ortalama'); writeln(Copy(cizgi,1,40)); satir:=2; end; procedure GenelOrtalama; var Gnot,SinifT:integer; Gn :byte; begin baslik2;sinifT:=0; for i:=1 to E do begin satir:=satir+1; gotoxy(1,satir);write(isim); Gnot:=0; for j:=1 to 12 do Gnot:=Gnot+Round(ort); Gn:=Round(Gnot/12); SinifT:=SinifT+Gn; Gotoxy(35,Satir);write(Gn:3); if satir=20 then begin gotoxy(20,25); write('Diger Sayfa i‡in Bir Tusa Basiniz..'); tus:=readkey; baslik2; end; end; writeln;writeln; writeln('Sinif Not Ortalama=','SinifT/E:'); gotoxy(15,25); write('Listelenecek Kayitlar Bitti.Bir Tusa Basiniz..'); tus:=readkey; end; { Ana Program } begin e:=0; fillchar(cizgi,80,205); cizgi[0]:=#79; repeat ilkekran; gotoxy(30,10);write(' 1- Bilgi Girisi '); gotoxy(30,12);write(' 2- Tum Liste '); gotoxy(30,14);write(' 3- Bilgi Arama '); gotoxy(30,16);write(' 4- Ders Ortalamalari '); gotoxy(30,1;write(' 5- Genel Ortalamalari '); gotoxy(30,20);write(' 6- Cikis '); gotoxy(30,22);write(' Se‡iminiz[1..6]'); gotoxy(30,24);write(' ˜yi gnlerde kullann '); repeat tus := readkey; until tus in ['1'..'6']; case tus of '1' :BilgiGirisi; '2' :TumListe; '3' :BilgiArama; '4' :Dersortalama; '5' :GenelOrtalama; '6' :Halt; end; { case } until 1=2; end.
Gönderi tarihi: 20 Mart , 2005 20 yıl Yazar 3(iki dolduran,bir boşaltan) musluk için kaç saatte bir açilip kapanacak ve tankin kapasitesine göre dolup dolamdiğini veren zaman sayaçli bir program. /* Musluk Programı*/ #include <stdio.h> int main (void) { int v,initial,pipe_a,pipe_b,pipe_drain,cycle_a,cycle_b ,cycle_drain,level,hour,x_a,x_b,x_drain; printf("TANK SIMULATION "); printf("Enter capacity of tank(lts.):"); scanf("%d",&v); printf("Enter initial level of tank(lts.):"); scanf("%d",&initial); printf("Enter rate of pipe A:(lts./hr.):"); scanf("%d",&pipe_a); printf("Enter rate of pipe B:(lts./hr.):"); scanf("%d",&pipe_; printf("Enter rate of drain:(lts./hr.):"); scanf("%d",&pipe_drain); printf("Open and closed cycle of pipe A(hrs.):"); scanf("%d",&cycle_a); printf("Open and closed cycle of pipe B(hrs.):"); scanf("%d",&cycle_; printf("Open and closed cycle of drain(hrs.):"); scanf("%d",&cycle_drain); printf("Hour Pipe A Pipe B Drain Level "); printf("%2d%9d%9d%9d%9d ",0,0,0,0,initial); level=initial; for(hour=1;level<=v&&level>0;hour=hour+1) { if(((hour-1)/cycle_a)%2==0) x_a=pipe_a; else x_a=0; if(((hour-1)/cycle_%2==0) x_b=pipe_b; else x_b=0; if(((hour-1)/cycle_drain)%2==0) x_drain=pipe_drain; else x_drain=0; level=level+x_a+x_b-x_drain; printf("%2d%9d%9d%9d%9d ",hour,x_a,x_b,x_drain,level); }//finished the for statement...... if(level>=v) printf("Tank is full!! Hours=%d",hour-1); //hour'u bir azaltmamin sebebi for statement'ta bir arttirip sonra kontrol etmesi(hour=hour+1) if(level<=0) printf("Tank is empty!! Hours=%d",hour-1); //hour'u bir azaltmamin sebebi for statement'ta bir arttirip sonra kontrol etmesi(hour=hour+1) getchar(); getchar(); getchar(); return(0); }
Gönderi tarihi: 20 Mart , 2005 20 yıl Yazar c Password #include <conio.h> #include <ctype.h> #include <string.h> int main(void) { int i=0; int curr_x = 16; char temp = ''; char pass[20] = "duke"; // this is the valid password char string[20] = { '' }; /* clear the screen */ clrscr(); //comment it if not using borland or turbo compiler /* Prompt the user for input */ textcolor( WHITE ); //this command might not work on some compilers cprintf("Enter Password: "); while( temp != ' ' ) { /* read the input */ temp = getch(); if( isprint( temp ) != 0 ) string = temp; /*prints stars instead of actual characters*/ if( iscntrl( temp ) == 0 ) { textcolor( WHITE ); //this command might not work on some compilers cprintf( "*" ); curr_x++; } if( temp == '' ) { gotoxy( curr_x, 1 ); cprintf( " " ); gotoxy( curr_x, 1 ); string[i-1] = ''; i--; curr_x--; } else i++; } if( strcmp( string, pass ) == 0 ) { textcolor( LIGHTBLUE ); //this command might not work on some compilers cprintf( " ACCESS !!!" ); } else { textcolor( LIGHTRED ); //this command might not work on some compilers cprintf( " ACCESS DENIED !!!" ); } /* display what was read */ textcolor( WHITE ); //this command might not work on some compilers cprintf(" The password entered is: %s", string); getch(); return 0; }
Gönderi tarihi: 20 Mart , 2005 20 yıl Yazar C dilinde hazırlanmış bu program ile fibonacci serileri recursive fonksyion kullanarak hesaplanmıştır. # include <stdio.h> double fibonacci (int f) { double ara1 , ara2; if (f<=1) return f; else { ara1 = fibonacci( (f-1) ) ; ara2 = fibonacci( (f-2) ) ; return ( ara1 + ara2); } } void main() { double sonuc; int sayi; printf ("Fibonacci bulunacak sayıyı giriniz :"); scanf("%d",&sayi); sonuc = fibonacci (sayi); printf ("%lf",sonuc); }
Katılın Görüşlerinizi Paylaşın
Şu anda misafir olarak gönderiyorsunuz. Hesabınız varsa, hesabınızla gönderi paylaşmak için ŞİMDİ OTURUM AÇIN.
Eğer üye değilseniz hemen KAYIT OLUN.
Not: İletiniz gönderilmeden önce bir Moderatör kontrolünden geçirilecektir.