trabalhos
commit
5bc4282098
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>com.mycompany</groupId>
|
||||||
|
<artifactId>exercicio12</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.release>24</maven.compiler.release>
|
||||||
|
<exec.mainClass>com.mycompany.exercicio12.Exercicio12</exec.mainClass>
|
||||||
|
</properties>
|
||||||
|
</project>
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue