using System.Collections.Generic;
public static void Main()
Accidente accidentado = new Accidente();
Console.WriteLine("Digite:"
+"\n0-Registrar accidentado"
+"\n1-Mostrar accidentados"
+"\n2-Modificar informacion"
+"\n4-Ordenar Datos Ascendentemente"
+"\n5-Ordenar Datos Ascendentemente"
opcion=int.Parse(Console.ReadLine());
Console.WriteLine("Reporte de accidente:");
Console.WriteLine("Escoga el # del que desea modificar");
indice=int.Parse(Console.ReadLine());
if(indice<0 || indice>accidentado.getIndice()){
Console.WriteLine("Digite valor valido");
}while(indice<0 || indice>accidentado.getIndice());
accidentado.modificar(indice);
accidentado.porcentaje();
accidentado.ascendente();
accidentado.descendente();
int[] edad= new int[100];
string [] genero= new string[100];
string [] identificacion = new string[100];
public void porcentaje(){
for (int a =0;a< this.indice;a++){
Console.WriteLine(mayores);
float porcentajeMayores=(float)mayores/this.indice;
float porcentajeMenores=(float)menores/this.indice;
Console.WriteLine("Porcentaje mayores:"+(porcentajeMayores)+"% ");
Console.WriteLine("Porcentaje menores:"+porcentajeMenores+"% ");
private int indi(string valor){
for(int n =0; n<=this.indice;n++){
if(valor==this.identificacion[n]){
public void descendente(){
int[] _edad= new int[this.indice];
string [] _genero= new string[this.indice];
string [] _identificacion = new string[this.indice];
string [] ordenado = _identificacion;
for(int n=0;n<this.indice;n++){
indice=this.indi(ordenado[n]);
_edad[n]=this.edad[indice];
_genero[n]=this.genero[indice];
_identificacion[n]=this.identificacion[indice];
this.identificacion=_identificacion;
public void ascendente(){
int[] _edad= new int[this.indice];
string [] _genero= new string[this.indice];
string [] _identificacion = new string[this.indice];
string [] ordenado = _identificacion;
for(int n=0;n<this.indice;n++){
indice=this.indi(ordenado[n]);
_edad[n]=this.edad[indice];
_genero[n]=this.genero[indice];
_identificacion[n]=this.identificacion[indice];
this.identificacion=_identificacion;
private int revisar(string valor){
for (int n =0; n < this.indice;n++){
if(identificacion[n]== valor){
Console.WriteLine("Esa identificacion existe. Digite otra");
Console.WriteLine("Digite identificacion del accidentado #"+(this.indice+1));
auxiliar=Console.ReadLine();
}while(revisar(auxiliar)==1);
identificacion[this.indice]=auxiliar;
Console.WriteLine("Digite edad del accidentado #"+(this.indice+1));
this.edad[this.indice]= int.Parse(Console.ReadLine());
if(this.edad[this.indice]<16 || this.edad[this.indice]>120){
Console.WriteLine("Digite una edad valida");
}while(this.edad[this.indice]<16 || this.edad[this.indice]>120);
Console.WriteLine("Digite:\n1-Hombre\n2-Mujer");
opcion=int.Parse(Console.ReadLine());
if(opcion<1 || opcion>2){
Console.WriteLine("Digite un valor valido");
this.genero[this.indice]="Hombre";
this.genero[this.indice]="Mujer";
}while(opcion<1 || opcion>2);
Console.WriteLine("#\tEdad\tGenero\tIdentificacion");
for(int i=0;i<this.indice;i++){
Console.WriteLine((this.indice-1)
+"\t"+this.identificacion[i]);
public void modificar(int indice){
Console.WriteLine("Digite nueva edad del accidentado");
this.edad[indice]= int.Parse(Console.ReadLine());
Console.WriteLine("Digite una edad valida");
}while(this.edad[indice] < 0);
Console.WriteLine("Digite:\n1-Hombre\n2-Mujer");
opcion=int.Parse(Console.ReadLine());
if(opcion<1 || opcion>2){
Console.WriteLine("Digite un valor valido");
this.genero[indice]="Hombre";
this.genero[indice]="Mujer";
}while(opcion<1 || opcion>2);