IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası
  sohbet

Yeni Konu aç Cevapla
 
LinkBack Seçenekler Stil
Alt 11 Temmuz 2014, 10:16   #1
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Not Ortalaması Hesaplama




C++ Builder projesidir.

StringGrid kontrolü yardımıyla not ortalamasını hesaplamayı sağlayan bir programdır. Vize ve final notu girilen öğrencinin ortalamasını hesaplar. Stringgrid kontrolünde tab ile hareket edilebilmesi için Options kısmından goTabs true yapılması gerekir.

Kod:   Kodu kopyalamak için üzerine çift tıklayın!
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { int k,j,sayi; k=StrToInt(Edit1->Text); this->StringGrid1->RowCount=k; this->StringGrid1->ColCount=7; this->StringGrid1->Cells[0][0]="Sira No"; this->StringGrid1->Cells[1][0]="Ogrenci No"; this->StringGrid1->Cells[2][0]="Adi Soyadi"; this->StringGrid1->Cells[3][0]="1.Vize"; this->StringGrid1->Cells[4][0]="Final"; this->StringGrid1->Cells[5][0]="Ortalama"; this->StringGrid1->Cells[6][0]="Harf Notu"; this->Button2->Enabled=true; this->Button3->Enabled=true; this->Button4->Enabled=true; for(j=1;j<StringGrid1->RowCount;j++) { sayi=j; this->StringGrid1->Cells[0][j]=IntToStr(sayi); } } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) { int*Vize; Vize=new int [this->StringGrid1->RowCount]; int i; for(i=1;i<StringGrid1->RowCount;i++) { Vize[i]=StrToInt(StringGrid1->Cells[3][i]); } float ortalama; float toplam=0; for(i=1;i<StringGrid1->RowCount;i++) { toplam+=Vize[i]; } ortalama=toplam/(this->StringGrid1->RowCount-1); Button2->Caption=FloatToStr(ortalama); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button3Click(TObject *Sender) { int*Final; Final=new int [this->StringGrid1->RowCount]; int i; for(i=1;i<StringGrid1->RowCount;i++) { Final[i]=StrToInt(StringGrid1->Cells[4][i]); } float Finalortalamasi; float toplam=0; for(i=1;i<StringGrid1->RowCount;i++) { toplam+=Final[i]; } Finalortalamasi=toplam/(this->StringGrid1->RowCount-1); Button3->Caption=FloatToStr(Finalortalamasi); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button4Click(TObject *Sender) { float a,b; int i,j; float sonuc; for(i=1;i<StringGrid1->RowCount;i++) { a=StrToFloat(this->StringGrid1->Cells[3][i]); b=StrToFloat(this->StringGrid1->Cells[4][i]); sonuc=((a*40.0)/100.0)+((b*60.0)/100.0); this->StringGrid1->Cells[5][i]=FloatToStr(sonuc); if(sonuc>100) {StringGrid1->Cells[6][i]="Gecersiz Not"; } else if(sonuc<=100 && sonuc>91) {StringGrid1->Cells[6][i]="AA"; } else if(sonuc<=91 && sonuc>83) {StringGrid1->Cells[6][i]="BA"; } else if(sonuc<=83 && sonuc>75) {StringGrid1->Cells[6][i]="BB"; } else if(sonuc<=75 && sonuc>67) {StringGrid1->Cells[6][i]="CB"; } else if(sonuc<=67 && sonuc>59) {StringGrid1->Cells[6][i]="CC"; } else if(sonuc<=59 && sonuc>49) {StringGrid1->Cells[6][i]="DC"; } else if(sonuc<=49 && sonuc>39) {StringGrid1->Cells[6][i]="DD"; } else if(sonuc<=39 && sonuc>29) {StringGrid1->Cells[6][i]="FD"; } else if(sonuc<=29 && sonuc>=0) {StringGrid1->Cells[6][i]="FF"; } } } //--------------------------------------------------------------------------- void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action) { int c; c=MessageDlg("Cikmak istiyor musunuz?",mtConfirmation,TMsgDlgButtons()<<mbYes<<mbNo,0); if(c==mrNo)//No secildiyse) Action=caNone;//Cikisi iptal et } //---------------------------------------------------------------------------


 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları sohbet odaları Benimmekan Mobil Sohbet
Cevapla

Etiketler
hesaplama, ortalaması


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 
Seçenekler
Stil

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Açık
Refbacks are Açık


Benzer Konular
Konu Konuyu Başlatan Forum Cevaplar Son Mesaj
IF Yaş Ortalaması Chelt IF Anket Arşivi 62 08 Ocak 2015 12:05
hız ortalaması. darksequen mIRC Scripting Sorunları 1 09 Şubat 2012 13:48
İl il Türkiye'nin yaş ortalaması PassioN Haber Arşivi 0 05 Şubat 2012 11:47