Вы находитесь на странице: 1из 4

/* ENUNCIADO : Hacer un programa que ordene las notas de

N alumnos en orden

auxNt = nota[i];
nota[i] = nota[j];

decreciente, mostrando el reporte:


Nombre

Nota

xxxx

99

xxxx

99

-----

----

nota[j] = auxNt;
// intercambio de nombres
strcpy (auxN , nom[ i]);
strcpy (nom[ i ], nom[ j]);

Promedio

99

strcpy (nom[ j ], auxN);


*/

// Librerias c++

#include<iostream.h>

#include<conio.h>

// muestra los arrays paralelos ordenados

#include<iomanip.h>
cout<<setw(20)<<"nombre"<<setw(20)<<"nota"<<endl;
#include<stdio.h>

for(i=0;i<N;i++)

#include<string.h>
{

cout<<setw(20)<<nom[i]<<setw(20)<<nota[i]<<endl;

const int N = 5, TC = 20;

int main()

cout<<setw(40)<<"-----"<<endl;
cout<<setw(40)<<PromN<<endl; getch();

{ double nota[N],auxNt, SNota, PromN;


return 0;
char nom[N][TC],auxN[TC];
}
int i,j;
#include <iostream.h> // cin y cout
// lectura de loa arrays nom y nota
SNota = 0;

#include <iomanip.h> // setw()


#include <conio.h>

// getch()

#include <stdlib.h>

// gets()

#include <string.h>

// strcmp() y strcpy()

for(i=0;i<N;i++)
{cout<<"Ingrese Nombres y Nota del alumno
"<<i+1<<endl;
cout<<"nombre: "<<endl;

#define dim 20

cin>>nom[i];

#define p20 0.2

cout<<"nota : ";cin>>nota[i];

#define p5 0.05

SNota = SNota + nota[i];

int main()

}
PromN = SNota/N;
// ordenamiento de notas de mayor a menor

char nom[dim][20];
float s[dim],dolar,mayor;

for(i=0;i<N;i++) // nro de pasos

int i,n,s25;

for(j=i+1;j<N;j++) // nro de comparaciones

s25=0;

// compara las notas

dolar=0;

if (nota[i]<nota[j])

do

{ // intercambio de notas

cout<<"Ingrese numero de Empledos : "<<endl;

for(i=0;i< n;i++)

cin>>n;

if(s[i]==mayor)

}while(n<0 || n>dim);

cout<<"Nombre : "<<nom[i]<<endl;

// LEE EL ARRAY DE NOMBRES y SUELDOS

system("pause");

cout<<"Ingrese los nombres Y sueldos de los


empleados : "<<endl;

//d
for(i=0;i< n;i++)

for(i=0;i< n;i++)

if(s[i]>=1200.00)

{ cout<<"nom["<<i+1<<"]=";

s[i]=s[i]+ s[i]*p5;

fflush(stdin);

else

// cin.getline(nom[i],30);
gets(nom[i]);
cout<<"sueldo["<<i+1<<"]=";

s[i]=s[i]+ s[i]*p20;
cout<<"Numero de empleados que ganan mas de 2500 :
"<<s25<<endl;

cin>>s[i];

cout<<"Total de sueldos en dolares : "<<dolar<<endl;

system("pause");

system("cls");

system("cls");

cout<<setw(10)<<"ORDEN "<<setw(20)<<"NOMBRES
"<<setw(10)<<"SUELDO"<<endl;

cout<<setw(10)<<"ORDEN "<<setw(20)<<"NOMBRES
"<<setw(10)<<"SUELDO"<<endl;

cout<<setw(40)<<"===================================
============O"<<endl;

cout<<setw(40)<<"===================================
============="<<endl;
for(i=0;i< n;i++)

for(i=0;i< n;i++)

cout<<setw(10)<<i+1<<setw(20)<<nom[i]<<setw(10)<<s[i]<<e
ndl;

cout<<setw(10)<<i+1<<setw(20)<<nom[i]<<setw(10)<<s[i]<<e
ndl;

system("pause");

system("pause");

//numero de empleados que ganan mas de 2500 soles

return 0;

for(i=0;i< n;i++)
if (s[i]>2500.00)
s25=s25+1;

// b

#include<iostream.h>

for(i=0;i< n;i++)

#include<stdlib.h>

dolar = dolar + s[i]/2.58;

#include<string.h>

mayor=s[0];

#include<iomanip.h>

// c

#define max 50

for(i=1;i< n;i++)

#define minimo 12

if(s[i]>mayor)
mayor=s[i];

int leerN()
{int n;

do

cout<<"Nombre ["<<i+1<<"] :"<<nom[i]<<endl;

{cout<<"Ingrese numero de alumnos :"<<endl;


cin>>n;

}while(n<1);
return n;

void vernota(float nota[],int n)

{int i;

void cargaNom(char nom[][20],int n)


{int i;

for(i=0;i<n;i++)
cout<<"Nota["<<i+1<<"] :"<<nota[i]<<endl;

for(i=0;i<n;i++)
{cout<<"Ingrese Nombre :"<<i+1<<"==> ";

fflush( stdin );
gets(nom[i]);

void verclave(char clave[])

{int i;

}
void cargaClav(char clave[])

for(i=0;i<10;i++)

{int i;
for(i=0;i<10;i++)

cout<<"Clave ["<<i+1<<"] :"<<clave[i]<<endl;


}

{cout<<" Clave ["<<i+1<<"]= ";


cin>>clave[i];

void verResp(char resp[])

clave[i]=toupper(clave[i]);

{int i;

}
}

for(i=0;i<10;i++)

void cargaResp(char resp[])

cout<<"respueta ["<<i+1<<"] :"<<resp[i]<<endl;

{int i;

for(i=0;i<10;i++)

void califica(float nota[],char clave[],char resp[],int n)

{cout<<" respuesta ["<<i+1<<"]= ";

{int i,j;

cin>>resp[i];

float cal;

resp[i]=toupper(resp[i]);

for(i=0;i<n;i++)

{cal=0;

cout<<"Carga respuesta del alumno : "<<i+1<<endl;

void mostrar(char nom[][20],int n)

cargaResp(resp);

{int i;

verResp(resp);
cout<<" I = "<<i<<endl;system("pause");

for(i=0;i<n;i++)

for(j=0;j<10;j++)

{if(j>-1&&j<4)
if(clave[j]==resp[j])
cal = cal + 2.0;

cout<<setw(20)<<"NOMBRES"<<setw(10)<<" NOTA
"<<setw(20)<<"OBSERVACION"<<endl;
cout<<setw(20)<<"*******"<<setw(10)<<" ****
"<<setw(20)<<"***********"<<endl;

else

for(i=0;i<n;i++)

cal= cal-1.5;

{cout<<setw(20)<<nom[i]<<setw(10)<<nota[i];

if(j>3&&j<7)

if(nota[i]>=minimo)

if(clave[j]==resp[j])

cout<<setw(20)<<" Ingreso "<<endl;

cal = cal + 3.0;

else

else

cout<<setw(20)<<" No Ingreso "<<endl;

cal= cal-1.0;

if(j>6&&j<10)

if(clave[j]==resp[j])

int main()

cal = cal + 1.0;

{ int n,ning=0;

else

char nombres[max][20],clave[10],resp[10],nomIng[max][20];

cal= cal- 0.5;

float Notapos[max],suma,media,ma,mi;

n=leerN();

nota[i]=cal;

cargaNom(nombres,n);

cargaClav(clave);

mostrar(nombres,n);

void cargaIng(char nom[][20],char nomI[][20],float nota[],int


n)

verclave(clave);
califica(Notapos,clave,resp,n);

{int i,ci=0;
vernota(Notapos,n);
for(i=0;i<n;i++)
cargaIng(nombres,nomIng,Notapos,n);
if(nota[i]>=minimo)
mostrarnota(nombres,Notapos,n);
{ci=ci+1;
system("pause");
strcpy(nomI[i],nom[i]);
cout<<nom[i]<<"===> "<<nota[i]<<"........ "<<"Ingreso
"<<endl;
}
else
cout<<nom[i]<<"===> "<<nota[i]<<"........ "<<"No Ingreso
"<<endl;
}
void mostrarnota(char nom[][20],float nota[],int n)
{int i;
system("cls");

return 0;
}

Вам также может понравиться