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("Biblioteca");
        
        // Paso 2
        int[] prestamos = {8, 12, 6, 10, 14};
        
        // Paso 3
        int totalSemanal = 0;
        for (int i = 0; i < prestamos.length; i++) {
            totalSemanal += prestamos[i];
        }
        
        // Paso 4
        double promedioDiario = (double) totalSemanal / prestamos.length;
        
        System.out.println("Comprobación: total = " + totalSemanal + " préstamos; promedio = " + promedioDiario + " por día.");
    }
}

Embed on website

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