Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: letras.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- using namespace std;
- int main()
- {
- char grado1, grado2, grado3;
- float pn;
- cout << "Computo Grado Promedio" << endl;
- cout << "======================" << endl;
- cout << "Entre el primer grado : "; cin >> grado1;
- cout << "Entre el segundo grado : "; cin >> grado2;
- cout << "Entre el tercer grado : "; cin >> grado3;
- grado1 -= (grado1==70?1:0);
- grado2 -= (grado2==70?1:0);
- grado3 -= (grado3==70?1:0);
- pn = 207 - (grado1 + grado2 + grado3); pn /= 3.0;
- cout << "El grado promedio es: ";
- if( pn > 3.5 ) cout << "A";
- else if (pn > 2.5 ) cout << "B";
- else if (pn > 1.5 ) cout << "C";
- else if (pn > 0.5 ) cout << "D";
- else cout << "F";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement