import [Link].
Scanner;
public class datosFiesta{
public static void main(String[]ar){
int edad=1;
int personas=0;
int mujeres=0;
int hombres=0;
String sexo="";
int joven=100;
float sexom=0.0f;
float sexof=0.0f;
float prom=0.0f;
Scanner teclado = new Scanner([Link]);
while (edad>0){
[Link]("ingrese su edad");
edad=[Link]();
if (edad<joven && edad>=18) {
joven=edad;
[Link](joven);
}
if (edad >=18){
[Link]("Ingrese su tipo de
sexo f si es femenino o m si es masculino");
sexo=[Link]();
if ([Link]("m") || [Link]("f"))
{
personas++;
if ([Link]("m")) {
hombres=hombres+1;
sexom=sexom+edad;
}if ([Link]("f")) {
mujeres=mujeres+1;
sexof=sexof+edad;
}
}else{
[Link]("no ingreso un
valor correcto intentelo de nuevo ");
}
}else{
[Link]("no cumple la mayotia
de edad no tiene permitido el ingreso");
}
}
[Link]("la cantidad de personas asistentes
fue: "+personas);
[Link]("la cantidad de mujeres asistentes
fue "+mujeres+" y de hombres "+hombres);
[Link]("promedio de edad para las mujeres
"+(sexof/mujeres)+" y el promedio de hombres "+(sexom/mujeres));
[Link]("la persona mas joven que asistio
tiene "+joven+" años");
}
}