Advertisement
idsystems

Cpp_Practica 20 - Promedio

Jan 26th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. // Program: promedio.cc
  2. // Author:  Yoan Pinzon
  3. // Date:    Agosto 30, 2006
  4.  
  5. #include <iostream>
  6. #include <iomanip>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.    double calif1, calif2, calif3, calif4, calif5, suma=0.0, promedio;
  13.  
  14.    cout << "Promedio de Cinco Notas" << endl;
  15.    cout << "=======================" << endl;
  16.  
  17.    cout << "Entre nota1 [0.0..5.0]= "; cin >> calif1;
  18.    cout << "Entre nota2 [0.0..5.0]= "; cin >> calif2;
  19.    cout << "Entre nota3 [0.0..5.0]= "; cin >> calif3;
  20.    cout << "Entre nota4 [0.0..5.0]= "; cin >> calif4;
  21.    cout << "Entre nota5 [0.0..5.0]= "; cin >> calif5;
  22.  
  23.    suma = calif1+calif2+calif3+calif4+calif5;
  24.    promedio = suma / 5.0;
  25.  
  26.    cout.setf(ios::fixed);
  27.    cout << setprecision(2) << endl;
  28.  
  29.    cout << "Promedio= " << promedio << endl;
  30.  
  31.    return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement