commit 62891bfb756cfa1d61de421b0ba24677e42a202b Author: 250413 <250413@THINKPAD13.epvc2.local> Date: Thu Nov 13 15:56:26 2025 +0000 comit inicial diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..53e2d3f --- /dev/null +++ b/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + com.mycompany + Exs12 + 1.0-SNAPSHOT + jar + + UTF-8 + 24 + com.mycompany.exs12.Exs12 + + \ No newline at end of file diff --git a/src/main/java/com/mycompany/exs12/Exs12.java b/src/main/java/com/mycompany/exs12/Exs12.java new file mode 100644 index 0000000..125a069 --- /dev/null +++ b/src/main/java/com/mycompany/exs12/Exs12.java @@ -0,0 +1,26 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ + +package com.mycompany.exs12; + +import java.util.Scanner; + +/** + * + * @author 250413 + */ +public class Exs12 { + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + double soma = 0; + for(int i = 0; i < 12 ; i++){ + System.out.println("Introduza o valor da fatura " + i + 1); + double valor = scanner.nextDouble(); + soma += valor; + } + double media = soma / 12; + System.out.println("A media das faturas é " + media); + } +}