diff --git a/1ano/2semestre/poo/out/production/poo/aula02/AverageSpeed.class b/1ano/2semestre/poo/out/production/poo/aula02/AverageSpeed.class index c4eab1f..cf29054 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/AverageSpeed.class and b/1ano/2semestre/poo/out/production/poo/aula02/AverageSpeed.class differ diff --git a/1ano/2semestre/poo/out/production/poo/aula02/CelciusToFahrenheit.class b/1ano/2semestre/poo/out/production/poo/aula02/CelciusToFahrenheit.class index fd19361..43c5fc4 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/CelciusToFahrenheit.class and b/1ano/2semestre/poo/out/production/poo/aula02/CelciusToFahrenheit.class differ diff --git a/1ano/2semestre/poo/out/production/poo/aula02/DistanceBetweenPoints.class b/1ano/2semestre/poo/out/production/poo/aula02/DistanceBetweenPoints.class index 122f743..4fa3fe4 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/DistanceBetweenPoints.class and b/1ano/2semestre/poo/out/production/poo/aula02/DistanceBetweenPoints.class differ diff --git a/1ano/2semestre/poo/out/production/poo/aula02/EnergyToHeatWater.class b/1ano/2semestre/poo/out/production/poo/aula02/EnergyToHeatWater.class index 858177d..0ec5dff 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/EnergyToHeatWater.class and b/1ano/2semestre/poo/out/production/poo/aula02/EnergyToHeatWater.class differ diff --git a/1ano/2semestre/poo/out/production/poo/aula02/Investment.class b/1ano/2semestre/poo/out/production/poo/aula02/Investment.class index 1826b61..0a8a46f 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/Investment.class and b/1ano/2semestre/poo/out/production/poo/aula02/Investment.class differ diff --git a/1ano/2semestre/poo/out/production/poo/aula02/KmToMiles.class b/1ano/2semestre/poo/out/production/poo/aula02/KmToMiles.class index 0d2e8cc..adde2b5 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/KmToMiles.class and b/1ano/2semestre/poo/out/production/poo/aula02/KmToMiles.class differ diff --git a/1ano/2semestre/poo/out/production/poo/aula02/PythagoreanTheorem.class b/1ano/2semestre/poo/out/production/poo/aula02/PythagoreanTheorem.class index bf8e1f6..3802356 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/PythagoreanTheorem.class and b/1ano/2semestre/poo/out/production/poo/aula02/PythagoreanTheorem.class differ diff --git a/1ano/2semestre/poo/out/production/poo/aula02/RealNumbers.class b/1ano/2semestre/poo/out/production/poo/aula02/RealNumbers.class index e2a5591..96ff9d6 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/RealNumbers.class and b/1ano/2semestre/poo/out/production/poo/aula02/RealNumbers.class differ diff --git a/1ano/2semestre/poo/out/production/poo/aula02/SecsToHMS.class b/1ano/2semestre/poo/out/production/poo/aula02/SecsToHMS.class index e78b87b..8f6ac3d 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/SecsToHMS.class and b/1ano/2semestre/poo/out/production/poo/aula02/SecsToHMS.class differ diff --git a/1ano/2semestre/poo/out/production/poo/tp_codecheck/README.md b/1ano/2semestre/poo/out/production/poo/tp_codecheck/README.md new file mode 100755 index 0000000..f49dbb0 --- /dev/null +++ b/1ano/2semestre/poo/out/production/poo/tp_codecheck/README.md @@ -0,0 +1,6 @@ +# Programação Orientada a Objetos +## Exercícios TP +### Resoluções para exercícios sugeridos nas aulas Teórico-Práticas + +--- +*Pode conter erros, caso encontre algum, crie um* [*ticket*](https://github.com/TiagoRG/uaveiro-leci/issues/new) diff --git a/1ano/2semestre/poo/Python-Java-Comparison.pdf b/1ano/2semestre/poo/slides/Python-Java-Comparison.pdf similarity index 100% rename from 1ano/2semestre/poo/Python-Java-Comparison.pdf rename to 1ano/2semestre/poo/slides/Python-Java-Comparison.pdf diff --git a/1ano/2semestre/poo/src/aula02/AverageSpeed.java b/1ano/2semestre/poo/src/aula02/AverageSpeed.java index e5fbe7a..6f1b11d 100644 --- a/1ano/2semestre/poo/src/aula02/AverageSpeed.java +++ b/1ano/2semestre/poo/src/aula02/AverageSpeed.java @@ -1,6 +1,9 @@ package aula02; import java.util.Scanner; + +// Código da package utils disponível em +// https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/src/utils import utils.UserInput; // Solução do exercício 5 @@ -18,7 +21,7 @@ public class AverageSpeed { double d2 = UserInput.getPositiveNumber(sin); double vm = (d1 + d2) / ((d1 / v1) + (d2 / v2)); - System.out.printf("Velocidade final da viagem: %.2fkm/h", vm); + System.out.printf("Velocidade final da viagem: %.2fkm/h\n", vm); sin.close(); } diff --git a/1ano/2semestre/poo/src/aula02/CelciusToFahrenheit.java b/1ano/2semestre/poo/src/aula02/CelciusToFahrenheit.java index 8d4d260..2a5f030 100644 --- a/1ano/2semestre/poo/src/aula02/CelciusToFahrenheit.java +++ b/1ano/2semestre/poo/src/aula02/CelciusToFahrenheit.java @@ -10,7 +10,7 @@ public class CelciusToFahrenheit { Scanner sin = new Scanner(System.in); double celcius = sin.nextDouble(); double fahrenheit = 1.8*celcius+32; - System.out.printf("%.2fºC = %.2fºF", celcius, fahrenheit); + System.out.printf("%.2fºC = %.2fºF\n", celcius, fahrenheit); sin.close(); } diff --git a/1ano/2semestre/poo/src/aula02/DistanceBetweenPoints.java b/1ano/2semestre/poo/src/aula02/DistanceBetweenPoints.java index af1c152..f936bec 100644 --- a/1ano/2semestre/poo/src/aula02/DistanceBetweenPoints.java +++ b/1ano/2semestre/poo/src/aula02/DistanceBetweenPoints.java @@ -1,5 +1,7 @@ package aula02; +// Código da package utils disponível em +// https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/src/utils import utils.UserInput; import java.util.Scanner; @@ -17,7 +19,7 @@ public class DistanceBetweenPoints { Math.pow(Double.parseDouble(p1[0]) - Double.parseDouble(p2[0]), 2) + Math.pow(Double.parseDouble(p1[1]) - Double.parseDouble(p2[1]), 2)); - System.out.printf("A distância entre os dois pontos é %.3f", distance); + System.out.printf("A distância entre os dois pontos é %.3f\n", distance); sin.close(); } diff --git a/1ano/2semestre/poo/src/aula02/EnergyToHeatWater.java b/1ano/2semestre/poo/src/aula02/EnergyToHeatWater.java index 1892a6f..1c3b9e0 100644 --- a/1ano/2semestre/poo/src/aula02/EnergyToHeatWater.java +++ b/1ano/2semestre/poo/src/aula02/EnergyToHeatWater.java @@ -1,5 +1,7 @@ package aula02; +// Código da package utils disponível em +// https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/src/utils import utils.UserInput; import java.util.Scanner; @@ -16,7 +18,7 @@ public class EnergyToHeatWater { System.out.print("Temperatura final da água (ºC)? "); double finalTemperature = sin.nextDouble(); double energy = kgOfWater * (finalTemperature - initialTemperature) * 4184; - System.out.printf("Para aquecer %.3fkg de água de %.2fºC para %.2fºC, serão necessários %.3fJ de energia.", kgOfWater, initialTemperature, finalTemperature, energy); + System.out.printf("Para aquecer %.3fkg de água de %.2fºC para %.2fºC, serão necessários %.3fJ de energia.\n", kgOfWater, initialTemperature, finalTemperature, energy); sin.close(); } diff --git a/1ano/2semestre/poo/src/aula02/Investment.java b/1ano/2semestre/poo/src/aula02/Investment.java index d1957b2..19fb880 100644 --- a/1ano/2semestre/poo/src/aula02/Investment.java +++ b/1ano/2semestre/poo/src/aula02/Investment.java @@ -1,5 +1,7 @@ package aula02; +// Código da package utils disponível em +// https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/src/utils import utils.UserInput; import java.util.Scanner; @@ -14,7 +16,7 @@ public class Investment { System.out.print("Taxa de juro mensal (%)? "); double tax = sin.nextDouble(); double finalWallet = initialWallet * Math.pow(1 + tax/100, 3); - System.out.printf("O saldo final será de %.2f euros", finalWallet); + System.out.printf("O saldo final será de %.2f euros\n", finalWallet); sin.close(); } diff --git a/1ano/2semestre/poo/src/aula02/KmToMiles.java b/1ano/2semestre/poo/src/aula02/KmToMiles.java index 2bd5b8a..ecacd6e 100644 --- a/1ano/2semestre/poo/src/aula02/KmToMiles.java +++ b/1ano/2semestre/poo/src/aula02/KmToMiles.java @@ -1,5 +1,7 @@ package aula02; +// Código da package utils disponível em +// https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/src/utils import utils.UserInput; import java.util.Scanner; @@ -12,7 +14,7 @@ public class KmToMiles { Scanner sin = new Scanner(System.in); double km = UserInput.getPositiveNumber(sin); double miles = km / 1.609; - System.out.printf("%.3fkm = %.3f miles", km, miles); + System.out.printf("%.3fkm = %.3f miles\n", km, miles); sin.close(); } diff --git a/1ano/2semestre/poo/src/aula02/PythagoreanTheorem.java b/1ano/2semestre/poo/src/aula02/PythagoreanTheorem.java index 4487e52..2a97f93 100644 --- a/1ano/2semestre/poo/src/aula02/PythagoreanTheorem.java +++ b/1ano/2semestre/poo/src/aula02/PythagoreanTheorem.java @@ -1,6 +1,7 @@ package aula02; -import utils.MathTools; +// Código da package utils disponível em +// https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/src/utils import utils.UserInput; import java.util.Scanner; @@ -19,7 +20,7 @@ public class PythagoreanTheorem { double c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2)); double angDeg = Math.acos(a / c) * 180 / Math.PI; - System.out.printf("O comprimento da hipotenusa é %.2f e o valor do angulo entre o cateto A e a hipotenusa é %.2f°", c, angDeg); + System.out.printf("O comprimento da hipotenusa é %.2f e o valor do angulo entre o cateto A e a hipotenusa é %.2f°\n", c, angDeg); sin.close(); } diff --git a/1ano/2semestre/poo/src/aula02/RealNumbers.java b/1ano/2semestre/poo/src/aula02/RealNumbers.java index 56d5c96..76969bf 100644 --- a/1ano/2semestre/poo/src/aula02/RealNumbers.java +++ b/1ano/2semestre/poo/src/aula02/RealNumbers.java @@ -28,7 +28,7 @@ public class RealNumbers { ++readNumbers; } - System.out.printf("Valor máximo: %f\nValor mínimo: %f\nMédia: %f\nTotal: %f", max, min, (float) sum/readNumbers, sum); + System.out.printf("Valor máximo: %f\nValor mínimo: %f\nMédia: %f\nTotal: %f\n", max, min, (float) sum/readNumbers, sum); sin.close(); } diff --git a/1ano/2semestre/poo/src/aula02/SecsToHMS.java b/1ano/2semestre/poo/src/aula02/SecsToHMS.java index 194127c..20b3aad 100644 --- a/1ano/2semestre/poo/src/aula02/SecsToHMS.java +++ b/1ano/2semestre/poo/src/aula02/SecsToHMS.java @@ -1,5 +1,7 @@ package aula02; +// Código da package utils disponível em +// https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/src/utils import utils.UserInput; import java.util.Scanner; @@ -16,7 +18,7 @@ public class SecsToHMS { int mins = Math.round((float) (totalSecs / 60)); int hours = Math.round((float) (mins / 60)); mins = mins % 60; - System.out.printf("%d segundos no formato hh:mm:ss : %d:%d:%d", totalSecs, hours, mins, secs); + System.out.printf("%d segundos no formato hh:mm:ss : %d:%d:%d\n", totalSecs, hours, mins, secs); sin.close(); }