SHARE
TWEET

PromedioC++

lukhavi Feb 21st, 2020 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. using namespace std;
  3. #define NUMERO_NOTAS 8
  4.  
  5. int main(){
  6.     int i;
  7.     float notas[NUMERO_NOTAS], suma,promedio;
  8.     suma = promedio = 0;
  9.     //const char *veces[NUMERO_NOTAS] = {"primera","segunda","tercera","cuarta","quinta","sexta","septima","octava"};
  10.     string veces[NUMERO_NOTAS] = {"primera","segunda","tercera","cuarta","quinta","sexta","septima","octava"};
  11.     for(int i = 0;i<NUMERO_NOTAS;i++){
  12.         cout<<"Digite su "<<veces[i]<<" calificacion:";
  13.         cin>>notas[i];
  14.         cin.ignore();
  15.         suma = suma+notas[i];
  16.     }
  17.     promedio = suma/NUMERO_NOTAS;
  18.     cout<<endl<<"Promedio: "<<promedio;
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top