Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #define MAX 10
- using namespace std;
- struct calificaciones{
- char *nombres = new char[10];
- float nota1;
- float nota2;
- float promedio;
- };
- int main() {
- char opcion;
- short c = 0;
- calificaciones *registro = new calificaciones[MAX];
- do
- {
- cout << "Registro de calificaciones "<<endl;
- cout << "Ingrese nombre: "; cin >> registro[c].nombres;
- cout << "Ingrese nota1: "; cin >> registro[c].nota1;
- cout << "Ingrese nota2: "; cin >> registro[c].nota2;
- registro[c].promedio = (registro[c].nota1 + registro[c].nota2) / 2;
- ++c;
- cout << "\n\t Desea Continuar(s/n) ";
- cin >> opcion;
- } while (toupper(opcion)=='S'||c==MAX);
- system("cls");
- cout << "\t Reporte de Estudiantes"<<endl;
- cout << "\t ======================" << endl;
- short c1 = 0;
- do
- {
- cout << registro[c1].nombres << "\t"
- << registro[c1].nota1 << "\t"
- << registro[c1].nota2 << "\t"
- <<"Promedio: "<< registro[c1].promedio<<endl;
- c1++;
- } while (c1<c);
- cin.get();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement