Programlama | Programlama Dilleri | C Programlama Dili |C++

Hata
  • XML Parsing Error at 1:82. Error 9: Invalid character
Anasayfa Programlama C++ Builder Not Ortalamas? Hesaplama


Not Ortalamas? Hesaplama

 AÇIKLAMA

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.  

Edit: vy_1566'n?n yazd??? kodda bir de?i?iklik yapmadan koda uygun olan proje tamamlanm?? ve sisteme konulmu?tur. (NEO) 

Program?n Tamam?n? A?a??daki Linkten ?ndirebilirsiniz

Linki Görebilmeniz ?çin Üye Olman?z Gerekmektedir...

Üye Kay?t 

 

Program Kodu:

  1.  
  2.  
  3. //---------------------------------------------------------------------------
  4.  
  5. #include <vcl.h>
  6. #pragma hdrstop
  7.  
  8. #include "Unit1.h"
  9. //---------------------------------------------------------------------------
  10. #pragma package(smart_init)
  11. #pragma resource "*.dfm"
  12. TForm1 *Form1;
  13. //---------------------------------------------------------------------------
  14. __fastcall TForm1::TForm1(TComponent* Owner)
  15.         : TForm(Owner)
  16. {
  17. }
  18. //---------------------------------------------------------------------------
  19.  
  20. void __fastcall TForm1::Button1Click(TObject *Sender)
  21. {
  22. int k,j,sayi;
  23. k=StrToInt(Edit1->Text);
  24. this->StringGrid1->RowCount=k;
  25. this->StringGrid1->ColCount=7;
  26. this->StringGrid1->Cells[0][0]="Sira No";
  27. this->StringGrid1->Cells[1][0]="Ogrenci No";
  28. this->StringGrid1->Cells[2][0]="Adi Soyadi";
  29. this->StringGrid1->Cells[3][0]="1.Vize";
  30. this->StringGrid1->Cells[4][0]="Final";
  31. this->StringGrid1->Cells[5][0]="Ortalama";
  32. this->StringGrid1->Cells[6][0]="Harf Notu";
  33. this->Button2->Enabled=true;
  34. this->Button3->Enabled=true;
  35. this->Button4->Enabled=true;
  36. for(j=1;j<StringGrid1->RowCount;j++)
  37. { sayi=j;
  38. this->StringGrid1->Cells[0][j]=IntToStr(sayi);
  39. }
  40. }
  41. //---------------------------------------------------------------------------
  42.  
  43. void __fastcall TForm1::Button2Click(TObject *Sender)
  44. {
  45. int*Vize;
  46. Vize=new int [this->StringGrid1->RowCount];
  47. int i;
  48. for(i=1;i<StringGrid1->RowCount;i++)
  49. {
  50. Vize[i]=StrToInt(StringGrid1->Cells[3][i]);
  51. }
  52. float ortalama;
  53. float toplam=0;
  54. for(i=1;i<StringGrid1->RowCount;i++)
  55. {
  56. toplam+=Vize[i];
  57. }
  58. ortalama=toplam/(this->StringGrid1->RowCount-1);
  59. Button2->Caption=FloatToStr(ortalama);
  60.  
  61.        
  62. }
  63. //---------------------------------------------------------------------------
  64. void __fastcall TForm1::Button3Click(TObject *Sender)
  65. {
  66. int*Final;
  67. Final=new int [this->StringGrid1->RowCount];
  68. int i;
  69. for(i=1;i<StringGrid1->RowCount;i++)
  70. {
  71. Final[i]=StrToInt(StringGrid1->Cells[4][i]);
  72. }
  73. float Finalortalamasi;
  74. float toplam=0;
  75. for(i=1;i<StringGrid1->RowCount;i++)
  76. {
  77. toplam+=Final[i];
  78. }
  79. Finalortalamasi=toplam/(this->StringGrid1->RowCount-1);
  80. Button3->Caption=FloatToStr(Finalortalamasi);
  81. }
  82. //---------------------------------------------------------------------------
  83. void __fastcall TForm1::Button4Click(TObject *Sender)
  84. {
  85. float a,b;
  86. int i,j;
  87. float sonuc;
  88. for(i=1;i<StringGrid1->RowCount;i++)
  89. {
  90. a=StrToFloat(this->StringGrid1->Cells[3][i]);
  91. b=StrToFloat(this->StringGrid1->Cells[4][i]);
  92. sonuc=((a*40.0)/100.0)+((b*60.0)/100.0);
  93. this->StringGrid1->Cells[5][i]=FloatToStr(sonuc);
  94.  
  95. if(sonuc>100)
  96. {StringGrid1->Cells[6][i]="Gecersiz Not"; }
  97.  
  98. else if(sonuc<=100 && sonuc>91)
  99. {StringGrid1->Cells[6][i]="AA"; }
  100.  
  101. else if(sonuc<=91 && sonuc>83)
  102. {StringGrid1->Cells[6][i]="BA"; }
  103.  
  104. else if(sonuc<=83 && sonuc>75)
  105. {StringGrid1->Cells[6][i]="BB"; }
  106.  
  107. else if(sonuc<=75 && sonuc>67)
  108. {StringGrid1->Cells[6][i]="CB"; }
  109.  
  110. else if(sonuc<=67 && sonuc>59)
  111. {StringGrid1->Cells[6][i]="CC"; }
  112.  
  113. else if(sonuc<=59 && sonuc>49)
  114. {StringGrid1->Cells[6][i]="DC"; }
  115.  
  116. else if(sonuc<=49 && sonuc>39)
  117. {StringGrid1->Cells[6][i]="DD"; }
  118.  
  119. else if(sonuc<=39 && sonuc>29)
  120. {StringGrid1->Cells[6][i]="FD"; }
  121.  
  122. else if(sonuc<=29 && sonuc>=0)
  123. {StringGrid1->Cells[6][i]="FF"; }
  124. }
  125. }
  126. //---------------------------------------------------------------------------
  127. void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
  128. {
  129. int c;
  130. c=MessageDlg("Cikmak istiyor musunuz?",mtConfirmation,TMsgDlgButtons()<<mbYes<<mbNo,0);
  131. if(c==mrNo)//No secildiyse)
  132. Action=caNone;//Cikisi iptal et
  133. }
  134. //---------------------------------------------------------------------------
  135.  
  136.  

Yorumlar (0)
Sadece kayıtlı kullanıcılar yorum yazabilir!
Son Güncelleme ( Salı, 04 Eylül 2012 03:06 )  
404 Not Found

404

Not Found

The resource requested could not be found on this server!


Proudly powered by LiteSpeed Web Server

Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.