commit 687177e594c50a68199cd66e871d5380b48290d7 Author: 250406 <250406@THINKPAD6.epvc2.local> Date: Thu Nov 13 15:52:57 2025 +0000 exercicio diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e2f1da9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + com.mycompany + for_s + 1.0-SNAPSHOT + jar + + UTF-8 + 24 + com.mycompany.for_s.For_s + + \ No newline at end of file diff --git a/src/main/java/com/mycompany/for_s/For_s.java b/src/main/java/com/mycompany/for_s/For_s.java new file mode 100644 index 0000000..fbb7e8a --- /dev/null +++ b/src/main/java/com/mycompany/for_s/For_s.java @@ -0,0 +1,28 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ + +package com.mycompany.for_s; + +import java.util.Scanner; + +/** + * + * @author 250406 + */ +public class For_s { + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); +for(int i = 0; i < 12; i++){ + +System.out.println("Introduza o valor da fatura "+(1 +1)); +double valor = scanner.nextDouble(); +soma += valor +} +double media = soma / 12; +System.out.println("A média das faturas é " + media); + } +} + +