commit 5bc4282098042e88cac929a73c517e052648a471 Author: 250406 <250406@localhost> Date: Wed Nov 19 15:30:31 2025 +0000 trabalhos diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..cd1d042 --- /dev/null +++ b/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + com.mycompany + exercicio12 + 1.0-SNAPSHOT + jar + + UTF-8 + 24 + com.mycompany.exercicio12.Exercicio12 + + \ No newline at end of file diff --git a/src/main/java/com/mycompany/exercicio12/Exercicio12.java b/src/main/java/com/mycompany/exercicio12/Exercicio12.java new file mode 100644 index 0000000..5a9545d --- /dev/null +++ b/src/main/java/com/mycompany/exercicio12/Exercicio12.java @@ -0,0 +1,29 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ + +package com.mycompany.exercicio12; + +import java.util.Scanner; + +/** + * + * @author 250406 + */ +public class Exercicio12 { + + 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 as faturas de eletrecidade no ano"); + double fatura = scanner.nextDouble(); + soma += fatura; + } + double media = soma / 12; + System.out.println("a media das faturas é " + media); + + } +} + \ No newline at end of file