From 3b8d10401e5ebfc63157d6c3508a58743cd295a4 Mon Sep 17 00:00:00 2001 From: 250422 <250422@THINKPAD22.epvc2.local> Date: Thu, 13 Nov 2025 15:57:21 +0000 Subject: [PATCH] commit inicial --- pom.xml | 13 ++++++++++ .../com/mycompany/exercicio1/Exercicio1.java | 26 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/com/mycompany/exercicio1/Exercicio1.java diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..39501bd --- /dev/null +++ b/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + com.mycompany + exercicio1 + 1.0-SNAPSHOT + jar + + UTF-8 + 24 + com.mycompany.exercicio1.Exercicio1 + + \ No newline at end of file diff --git a/src/main/java/com/mycompany/exercicio1/Exercicio1.java b/src/main/java/com/mycompany/exercicio1/Exercicio1.java new file mode 100644 index 0000000..9bb9767 --- /dev/null +++ b/src/main/java/com/mycompany/exercicio1/Exercicio1.java @@ -0,0 +1,26 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ + +package com.mycompany.exercicio1; + +import java.util.Scanner; + +/** + * + * @author 250422 + */ +public class Exercicio1 { + + 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 média das faturas é " + media); + } +}