• Bu site çerezler kullanır. Bu siteyi kullanmaya devam ederek çerez kullanımımızı kabul etmiş olursunuz. Daha fazla bilgi edin.

C++ - Vize-Final Ortalaması ve Harf Verme

Konuyu Okuyan Kişiler (0)

Carizmatic

New member
Katılım
6 Ağu 2012
Mesajlar
1,672
Beğeniler
0
Konum
Webmaster.TC
#1
Kod:
// Calculate the avarage and grade about University
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int firsmidterm,secondmidterm,final;
double f;
cout << "Enter the first,second midterm and final score: " << endl;
cin >> firsmidterm >> secondmidterm >> final;
f= (firsmidterm*0.30) + (secondmidterm*0.30) + (final*0.40) ;
if( f <= 45 )
cout << "Grade:FF (Fail) - Avarage:" << f << endl;
else if(46 <= f && f <= 49)
cout << "Grade: FD (Fail) - Avarage::" << f << endl;
else if(50 <= f && f <= 59)
cout << "Grade: DD - Avarage::" << f << endl;
else if(60 <= f && f <= 64)
cout << "Grade: DC - Avarage::" << f << endl;
else if(65 <= f && f <= 74)
cout << "Grade: CC - Avarage::" << f << endl;
else if(75 <= f && f <= 80)
cout << "Grade: CB - Avarage::" << f << endl;
else if(81 <= f && f <= 85)
cout << "Grade: BB - Avarage::" << f << endl;
else if(86 <= f && f <= 90)
cout << "Grade: BA - Avarage::" << f << endl;
else if(91 <= f && f <= 100)
cout << "Grade: AA - Avarage::" << f << endl;
system ("pause");
return 0;
}
Ders için yapılmıştır.