Last active
August 29, 2015 14:22
-
-
Save errrzarrr/cf31b17c73cb409c6a69 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************** | |
* | |
* PROYECTO FINAL - Calcula Índice | |
* | |
* Roberto Miñagorri | |
* Matrícula:27436 | |
* | |
* Introducción a la Programación | |
* Profesor Guillermo Hernández | |
* Grupo 3- | |
* | |
**********************************************************/ | |
#include <iostream> | |
#include <limits> | |
using namespace std; | |
void presentaMaterias(int numeroCuatrimestre) { | |
switch(numeroCuatrimestre) { | |
case 1: | |
cout <<endl | |
<<"Eligio Primer Periodo Cuatrimestal (21 creditos)" <<endl | |
<< "\tING-101 - Ingles Tecnico (4 creditos)" <<endl | |
<< "\tTI-101 - Fundamentos del Computador (4 creditos)" <<endl | |
<< "\tMAT-001 - Precalculo (5 creditos)" <<endl | |
<< "\tESP-001 - Redaccion Castellana (4 creditos)" <<endl | |
<< "\tHIS-001 - Historia Dominicana (4 creditos)" <<endl | |
<<endl; | |
break; | |
case 2: | |
cout <<endl | |
<<"Eligio Segundo Periodo Cuatrimestral (13 creditos)" <<endl | |
<< "\tSOF-001 - Fundamentos de Programacion (4 creditos)" <<endl | |
<< "\tSOF-006 - Introduccion a las Bases de Datos (4 creditos)" <<endl | |
<< "\tMAT-002 - Calculo Diferencial (5 creditos)" <<endl | |
<<endl; | |
break; | |
case 3: | |
cout <<endl | |
<<"Eligio Tercer Periodo Cuatrimestral (12 creditos)" <<endl | |
<< "\tSOF-003 - Programacion I (4 creditos)" <<endl | |
<< "\tFIL-001 - Etica Social y Profesional (3 creditos)" <<endl | |
<< "\tMAT-003 - Calculo Integral (5 creditos)" <<endl | |
<<endl; | |
break; | |
case 4: | |
cout <<endl | |
<<"Eligio Cuarto Periodo Cuatrimestral (17 creditos)" <<endl | |
<< "\tSOF-007 - Analisis y Diseño (4 creditos)" <<endl | |
<< "\tSOF-008 - Bases de Datos Avanzadas (4 creditos)" <<endl | |
<< "\tSOF-004 - Programacion II (4 creditos)" <<endl | |
<< "\tFIS-001 - Fisica Aplicada I (5 creditos)" <<endl | |
<<endl; | |
break; | |
case 5: | |
cout <<endl | |
<<"Eligio Quinto Periodo Cuatrimestral (16 creditos)" <<endl | |
<< "\tSOF-009 - Auditoria Informatica (4 creditos)" <<endl | |
<< "\tSOF-005 - Programacion III (4 creditos)" <<endl | |
<< "\tSOF-010 - Diseño Centrado en el Usuario (4 creditos)" <<endl | |
<< "\tSOF-011 - Programacion Web (4 creditos)" <<endl | |
<<endl; | |
break; | |
case 6: | |
cout <<endl | |
<<"Eligio Sexto Periodo Cuatrimestral (16 creditos)" <<endl | |
<< "\tSOF-012 - Estructura de Datos (4 creditos)" <<endl | |
<< "\tSOF-013 - Administracion de Proyectos de Software (4 creditos)" <<endl | |
<< "\tSOF-014 - Mineria de Datos e Inteligencia de Negocios (4 creditos)" <<endl | |
<< "\tSOF-015 - Intro. a la Ingenieria de Software (4 creditos)" <<endl | |
<<endl; | |
break; | |
} | |
} | |
int deLiteralAnumerico(char notaLiteral) { | |
int notaNumerica = 0; | |
notaLiteral = toupper(notaLiteral); | |
switch(notaLiteral) { | |
case 'A': | |
notaNumerica = 4; | |
break; | |
case 'B': | |
notaNumerica = 3; | |
break; | |
case 'C': | |
notaNumerica = 2; | |
break; | |
case 'D': | |
notaNumerica = 1; | |
break; | |
case 'F': | |
notaNumerica = 0; | |
break; | |
case 'R': | |
notaNumerica = -1; | |
break; | |
default: | |
notaNumerica = -2; | |
break; | |
} | |
return notaNumerica; | |
} | |
int validaMatriculaEstudiante() { | |
int entradaUsuario; | |
bool valido = false; | |
do { | |
cout <<"Escriba matricula del estudiante: " <<flush; | |
cin >>entradaUsuario; | |
if (cin.good()) { | |
valido = true; | |
} | |
else { | |
cin.clear(); | |
cin.ignore(numeric_limits<streamsize>::max(),'\n'); | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl; | |
} | |
} while (!valido); | |
return entradaUsuario; | |
} | |
int validaEntradaSemestre() { | |
int numeroCuatrimestre = 0; | |
cin >>numeroCuatrimestre; | |
if (cin.good()) { | |
} | |
else { | |
cin.clear(); | |
cin.ignore(numeric_limits<streamsize>::max(),'\n'); | |
numeroCuatrimestre = 0; | |
} | |
return numeroCuatrimestre; | |
} | |
void presentaEncabezado() { | |
cout <<endl <<endl | |
<<"******************************************************************************" <<endl <<endl | |
<<"\t\t\tCALCULA INDICE" <<endl <<endl | |
<<"******************************************************************************" <<endl <<endl; | |
} | |
int main(int argc, char* argv[]) { | |
string nombreEstudiante = ""; | |
char notaLiteral; | |
int matriculaEstudiante = 0, numeroCuatrimestre = 0, notaNumerica = 0, | |
todosLosCuatrimestres = 6, sumaNotaPorCreditos = 0, | |
creditosEstaMateria = 0, | |
creditosAcumulados = 0, sumaNotaPorCreditosAcumulados = 0, | |
CREDITOS_CUATRIMESTRE[ ] = {21, 13, 12, 17, 16, 16}; | |
bool listoCuatrimestre[7] = {false}; | |
float indiceCuatrimestre1 = 0.00, indiceCuatrimestre2 = 0.00, indiceCuatrimestre3 = 0.00, | |
indiceCuatrimestre4 = 0.00, indiceCuatrimestre5 = 0.00, indiceCuatrimestre6 = 0.00, | |
indiceAcumulado = 0.0; | |
presentaEncabezado(); | |
cout <<"Escriba nombre del estudiante: "; | |
getline(cin, nombreEstudiante); | |
matriculaEstudiante = validaMatriculaEstudiante(); | |
cout <<endl <<"Buen dia Sr(a) " <<nombreEstudiante <<" [matricula: "<<matriculaEstudiante <<"] "<<endl <<endl; | |
while (todosLosCuatrimestres != 0) { | |
while(numeroCuatrimestre == 0) { | |
cout <<"Cuatrimestres disponibles (TECNOLOGO EN SOFTWARE): " <<endl; | |
if(!listoCuatrimestre[1]) { | |
cout << "\t[1] 1er Cuatrimestre" <<endl; | |
} | |
if(!listoCuatrimestre[2]) { | |
cout << "\t[2] 2do Cuatrimestre" <<endl; | |
} | |
if(!listoCuatrimestre[3]) { | |
cout << "\t[3] 3er Cuatrimestre" <<endl; | |
} | |
if(!listoCuatrimestre[4]) { | |
cout << "\t[4] 4to Cuatrimestre" <<endl; | |
} | |
if(!listoCuatrimestre[5]) { | |
cout << "\t[5] 5to Cuatrimestre" <<endl; | |
} | |
if(!listoCuatrimestre[6]) { | |
cout << "\t[6] 6to Cuatrimestre" <<endl; | |
} | |
cout <<"Elija un Cuatrimestre del menu: "; | |
numeroCuatrimestre = validaEntradaSemestre(); | |
if(numeroCuatrimestre <= 0 || numeroCuatrimestre > 6 || listoCuatrimestre[numeroCuatrimestre]) { | |
cout <<endl<<"Opcion invalida! Solo puede elegir entre los "; | |
numeroCuatrimestre = 0; | |
} | |
} | |
presentaMaterias(numeroCuatrimestre); | |
switch(numeroCuatrimestre) { | |
case 1: | |
sumaNotaPorCreditos = 0; | |
do { | |
cout <<"Nota para ING-101 - Ingles Tecnico (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para TI-101 - Fundamentos del Computador (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para MAT-001 - Precalculo (5 creditos): "; | |
creditosEstaMateria = 5; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para ESP-001 - Redaccion Castellana (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para HIS-001 - Historia Dominicana (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
cout <<endl <<"Indice del cuatrimestre #" <<numeroCuatrimestre <<": "; | |
if (CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] <= 0) { | |
cout <<" RETIRADO"; | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] = 21; | |
} else { | |
todosLosCuatrimestres -= 1; | |
listoCuatrimestre[numeroCuatrimestre] = true; | |
indiceCuatrimestre1 = (float) sumaNotaPorCreditos / (float) CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
cout.precision(2); | |
cout <<fixed <<indiceCuatrimestre1 <<endl; | |
creditosAcumulados += CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
sumaNotaPorCreditosAcumulados += sumaNotaPorCreditos; | |
indiceAcumulado = (float) sumaNotaPorCreditosAcumulados / (float) creditosAcumulados; | |
} | |
cout.precision(2); | |
cout <<endl <<"INDICE ACUMULADO: " <<fixed <<indiceAcumulado <<endl <<endl; | |
break; | |
case 2: | |
sumaNotaPorCreditos = 0; | |
do { | |
cout <<"Nota para SOF-001 - Fundamentos de Programacion (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-006 - Introduccion a las Bases de Datos (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para MAT-002 - Calculo Diferencial (5 creditos): "; | |
creditosEstaMateria = 5; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
cout <<endl <<"Indice del cuatrimestre #" <<numeroCuatrimestre <<": "; | |
if (CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] <= 0) { | |
cout <<" RETIRADO"; | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] = 13; | |
} else { | |
todosLosCuatrimestres -= 1; | |
listoCuatrimestre[numeroCuatrimestre] = true; | |
indiceCuatrimestre2 = (float) sumaNotaPorCreditos / (float) CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
cout.precision(2); | |
cout <<fixed <<indiceCuatrimestre2 <<endl; | |
creditosAcumulados += CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
sumaNotaPorCreditosAcumulados += sumaNotaPorCreditos; | |
indiceAcumulado = (float) sumaNotaPorCreditosAcumulados / (float) creditosAcumulados; | |
} | |
cout.precision(2); | |
cout <<endl <<"INDICE ACUMULADO: " <<fixed <<indiceAcumulado <<endl <<endl; | |
break; | |
case 3: | |
sumaNotaPorCreditos = 0; | |
do { | |
cout <<"Nota para SOF-003 - Programacion I (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para FIL-001 - Etica Social y Profesional (3 creditos): "; | |
creditosEstaMateria = 3; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para MAT-003 - Calculo Integral (5 creditos): "; | |
creditosEstaMateria = 5; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
cout <<endl <<"Indice del cuatrimestre #" <<numeroCuatrimestre <<": "; | |
if (CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] <= 0) { | |
cout <<" RETIRADO"; | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] = 12; | |
} else { | |
todosLosCuatrimestres -= 1; | |
listoCuatrimestre[numeroCuatrimestre] = true; | |
indiceCuatrimestre3 = (float) sumaNotaPorCreditos / (float) CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
cout.precision(2); | |
cout <<fixed <<indiceCuatrimestre3 <<endl; | |
creditosAcumulados += CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
sumaNotaPorCreditosAcumulados += sumaNotaPorCreditos; | |
indiceAcumulado = (float) sumaNotaPorCreditosAcumulados / (float) creditosAcumulados; | |
} | |
cout.precision(2); | |
cout <<endl <<"INDICE ACUMULADO: " <<fixed <<indiceAcumulado <<endl <<endl; | |
break; | |
case 4: | |
sumaNotaPorCreditos = 0; | |
do { | |
cout <<"Nota para SOF-007 - Analisis y Diseño (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-008 - Bases de Datos Avanzadas (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-004 - Programacion II (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para FIS-001 - Fisica Aplicada I (5 creditos): "; | |
creditosEstaMateria = 5; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
cout <<endl <<"Indice del cuatrimestre #" <<numeroCuatrimestre <<": "; | |
if (CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] <= 0) { | |
cout <<" RETIRADO"; | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] = 17; | |
} else { | |
todosLosCuatrimestres -= 1; | |
listoCuatrimestre[numeroCuatrimestre] = true; | |
indiceCuatrimestre4 = (float) sumaNotaPorCreditos / (float) CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
cout.precision(2); | |
cout <<fixed <<indiceCuatrimestre4 <<endl; | |
creditosAcumulados += CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
sumaNotaPorCreditosAcumulados += sumaNotaPorCreditos; | |
indiceAcumulado = (float) sumaNotaPorCreditosAcumulados / (float) creditosAcumulados; | |
} | |
cout.precision(2); | |
cout <<endl <<"INDICE ACUMULADO: " <<fixed <<indiceAcumulado <<endl <<endl; | |
break; | |
case 5: | |
sumaNotaPorCreditos = 0; | |
do { | |
cout <<"Nota para SOF-009 - Auditoria Informatica (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-005 - Programacion III (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-010 - Diseño Centrado en el Usuario (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-011 - Programacion Web (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
cout <<endl <<"Indice del cuatrimestre #" <<numeroCuatrimestre <<": "; | |
if (CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] <= 0) { | |
cout <<" RETIRADO"; | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] = 16; | |
} else { | |
todosLosCuatrimestres -= 1; | |
listoCuatrimestre[numeroCuatrimestre] = true; | |
indiceCuatrimestre5 = (float) sumaNotaPorCreditos / (float) CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
cout.precision(2); | |
cout <<fixed <<indiceCuatrimestre5 <<endl; | |
creditosAcumulados += CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
sumaNotaPorCreditosAcumulados += sumaNotaPorCreditos; | |
indiceAcumulado = (float) sumaNotaPorCreditosAcumulados / (float) creditosAcumulados; | |
} | |
cout.precision(2); | |
cout <<endl <<"INDICE ACUMULADO: " <<fixed <<indiceAcumulado <<endl <<endl; | |
break; | |
case 6: | |
sumaNotaPorCreditos = 0; | |
do { | |
cout <<"Nota para SOF-012 - Estructura de Datos (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-013 - Administracion de Proyectos de Software (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-014 - Mineria de Datos e Inteligencia de Negocios (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
do { | |
cout <<"Nota para SOF-015 - Intro. a la Ingenieria de Software (4 creditos): "; | |
creditosEstaMateria = 4; | |
cin >> notaLiteral; | |
notaNumerica = deLiteralAnumerico(notaLiteral); | |
if(notaNumerica == -2) { | |
cout <<endl <<"Entrada invalida. Por favor, verificar y re-escribir." <<endl | |
<<"Entradas validas: [A, B, C, D, F, R]" <<endl; | |
} | |
else if(notaNumerica == -1) { | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] -= creditosEstaMateria; | |
} else { | |
sumaNotaPorCreditos += creditosEstaMateria * notaNumerica; | |
} | |
} while (notaNumerica == -2); | |
cout <<endl <<"Indice del cuatrimestre #" <<numeroCuatrimestre <<": "; | |
if (CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] <= 0) { | |
cout <<" RETIRADO"; | |
CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1] = 16; | |
} else { | |
todosLosCuatrimestres -= 1; | |
listoCuatrimestre[numeroCuatrimestre] = true; | |
indiceCuatrimestre6 = (float) sumaNotaPorCreditos / (float) CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
cout.precision(2); | |
cout <<fixed <<indiceCuatrimestre6 <<endl; | |
creditosAcumulados += CREDITOS_CUATRIMESTRE[numeroCuatrimestre - 1]; | |
sumaNotaPorCreditosAcumulados += sumaNotaPorCreditos; | |
indiceAcumulado = (float) sumaNotaPorCreditosAcumulados / (float) creditosAcumulados; | |
} | |
cout.precision(2); | |
cout <<endl <<"INDICE ACUMULADO: " <<fixed <<indiceAcumulado <<endl <<endl; | |
break; | |
} | |
numeroCuatrimestre = 0; | |
} | |
cout <<endl<<endl <<"Presione cualquier tecla para salir: "; | |
cin >>nombreEstudiante; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment