import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");

        int[] asistencia = {18, 20, 17, 19, 21};

int total = 0;

for (int i = 0; i < asistencia.length; i++) {
    total += asistencia[i];
}

double promedio = (double) total / asistencia.length;

System.out.println("Total: " + total);
System.out.println("Promedio: " + promedio);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: