Buen día a todos!.
<meta charset="UTF-8">
<h1>FAMILY AVERAGE AGES</h1>
<script>
function saltarLinea() {
document.write("<br>");
document.write("<br>");
document.write("<br>" + "<hr>");
document.write("<br>");
document.write("<br>");
}
function imprimir(frase) {
document.write("<big>" + frase + "</big>");
saltarLinea();
}
var familyMembers = parseInt(prompt("How many members are in the family? "));
var memberAge = 0;
var familyAverage = 0;
var totalAge = 0;
imprimir("FAMILY AGE AVERAGE");
for (i=1; i <= familyMembers; i++){
memberAge = parseInt(prompt("Enter the age of the member # " + i));
familyAverage = (familyAverage + memberAge)/i;
totalAge = totalAge + memberAge;
familyAverage = totalAge/i;
}
imprimir("Family average: " + familyAverage);
imprimir("Game over");
</script>
Espero haber aportado al grupo. Un saludo.