Professional Documents
Culture Documents
Examen Final Andres Villarroel
Examen Final Andres Villarroel
h>
#include <windows.h>
#include <string.h>
#include <iostream.h>
//using namespace std;
// Andres Villarroel 302993
#define cnt_max_string 10
#define cnt_char_ver 'x'
#define cnt_char_hor '-'
#define cnt_char_marco '*'
#define cnt_char_limpiar ' '
#define cnt_col_pant 5
#define cnt_fil_pant 2
#define cnt_col_mat 20
#define cnt_fil_mat 20
#define cnt_vec 20
#define cnt_num_campos 2
float mat_a[10][5];
float andres;
int mv;
float vnc11,vnc111,vnc1111,vnc11111;
float vnc22,vnc222,vnc2222,vnc22222;
int VOPCION;
int VLV;
int Vfilas,Vcolumnas,edad;
float vlc1,vlc2,vlef,vlco;
float acc1,acc2,acef,acco;
float vnc1,vnc2,vnef,vnco,promedio;
int Vcodigo;
int Vbusqueda;
int Vfila_B;
float Vec_c1[5],Vec_c2[5],Vec_ef[5],Vec_co[5];
struct Tpersona{
int codigo;
char nombres[cnt_max_string];
}Vec_per[cnt_vec];
struct Tpersona Mat_per [cnt_fil_mat] [cnt_col_mat];
/*void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
} */
void Linea (char Ptipo,char Pcaracter,int Pfil, int Pcol,int Pfili,int Pcoli)
{
int vsm,vsmi,vsmf;
int vsl,vsli,vslf;
int vsinc;
switch(Ptipo)
{
case 'A':
vsli=(cnt_col_pant-1); vslf=((cnt_max_string*Pcol)+vsli+Pcol);
vsmi=(cnt_fil_pant-1); vsmf=(((cnt_num_campos+1)*Pfil))+1;
vsinc=cnt_max_string+1;
break;
case 'N':
vsli=(cnt_fil_pant-1); vslf=(((cnt_num_campos+1)*Pfil))+1;
vsmi=(cnt_col_pant-1); vsmf=((cnt_max_string*Pcol)+vsmi+Pcol);
vsinc=cnt_num_campos+1;
break;
case 'D':
vsli=Pcoli; vslf=Pcol; vsmi=Pfili; vsmf=Pfil; vsinc=Pcol-Pcoli;
break;
case 'R':
vsli=Pfili; vslf=Pfil; vsmi=Pcoli; vsmf=Pcol; vsinc=Pfil-Pfili;
break;
case 'E':
vsli=Pfili; vslf=Pfil; vsmi=Pcoli; vsmf=Pcol; vsinc=1;
break;
}
for (vsl=vsli;vsl<=vslf;vsl+=vsinc)
{
for (vsm=vsmi;vsm<=vsmf;vsm++)
{
switch(Ptipo)
{
case 'A': gotoxy(vsl,vsm); cout<< Pcaracter; break;
case 'N': gotoxy(vsm,vsl); cout<< Pcaracter; break;
case 'D': gotoxy(vsl,vsm); cout<< Pcaracter; break;
case 'R': gotoxy(vsm,vsl); cout<< Pcaracter; break;
case 'E': gotoxy(vsl,vsm); cout<< Pcaracter; break;
}
}
}
}
void Vector (int Plv, char Popcion)
{
int vsy=0;
for (int vsf = 0 ; vsf < Plv ; vsf++)
{
switch(Popcion)
{
case 'M':
gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+0));cin>> Vec_per[vsf].codigo;
gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+1));cin>> Vec_per[vsf].nombres;
break;
case 'H':
gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+0));cout<< Vec_per[vsf].codigo;
gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+1));cout<< Vec_per[vsf].nombres;
break;
case 'S':
if (Vec_per[vsf].codigo == Vcodigo)
{
Vbusqueda=1;
Vfila_B=vsf;
}
break;
} // fin del switch
vsy+=cnt_num_campos+1;
} // fin del for vsf
}// fin del void vector
void notas(int Plv,int Popcion)
{
int wa;
mv=0;
ma=0;
while (ma!=VLV)
{
for (int vsf = 0 ; vsf < Plv ; vsf++)
{
acc1 = 0;acc2 = 0;acef = 0;acco = 0; promedio = 0;
switch (Popcion)
{int vsn;
case 1:
cout<<"Ingrese numero de notas en CAT 1: ";
cin>> vlc1;
for ( vsn = 0 ; vsn < vlc1 ; vsn++)
{
cout<<"Ingrese calificacion por pregunta: ";
cin>> Vec_c1[vsf];
acc1 = acc1 + Vec_c1[vsf];
vnc1 = (acc1*0.2);
}
break;
case 2:
cout<<"Ingrese numero de notas en CAT 2: ";
cin>> vlc2;
for (vsn = 0 ; vsn < vlc2 ; vsn++)
{
cout<<"Ingrese calificacion por pregunta: ";
cin>> Vec_c2[vsf];
acc2 = acc2 + Vec_c2[vsf];
vnc2 = (acc2*0.25);
}
break;
case 3:
cout<<"Ingrese numero de notas en EX.FINAL: ";
cin>> vlef;
for ( vsn = 0 ; vsn < vlef ; vsn++)
{
cout<<"Ingrese calificacion por pregunta: ";
cin>> Vec_ef[vsf];
acef = acef + Vec_ef[vsf];
vnef = (acef*0.3);
}
break;
case 4:
cout<<"Ingrese numero de notas en CONTROL: ";
cin>> vlco;
for ( vsn = 0 ; vsn < vlco ; vsn++)
{
cout<<"Ingrese calificacion por pregunta: ";
cin>> Vec_co[vsf];
acco = acco + Vec_co[vsf];
vnco = (acco*0.25);
andres=vnco+vnef+vnc2+vnc1;
}
break;
}
}
ma=ma+1;
}// fin del while
}
case 0:
cout<<"\n";
cout<< "\nPulse cualquier tecla para continuar";
getche();
vsbandera=0;
}
}
}
void main(void)
{ menu(); }