From d9272be37c50dd7a54fb6d63712a60485e979859 Mon Sep 17 00:00:00 2001 From: TiagoRG <35657250+TiagoRG@users.noreply.github.com> Date: Sat, 18 Feb 2023 20:46:55 +0000 Subject: [PATCH] Python-like input method and README update --- 1ano/2semestre/poo/src/aula02/README.md | 9 +++++++++ 1ano/2semestre/poo/src/utils/UserInput.java | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/1ano/2semestre/poo/src/aula02/README.md b/1ano/2semestre/poo/src/aula02/README.md index 4a3635a..de42a52 100755 --- a/1ano/2semestre/poo/src/aula02/README.md +++ b/1ano/2semestre/poo/src/aula02/README.md @@ -5,5 +5,14 @@ * [GuiĆ£o](https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/guides/POO-2021-aula02.pdf) * [Slides](https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/2semestre/poo/slides/POO_02_ControloFluxo.pdf) +### Exercise List +| Exercise Number | File Name | Exercise Number | File Name | +|-----------------|----------------------------------------------------------------------------------------------------------------------------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------| +| 1 | [KmToMiles.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/KmToMiles.java) | 6 | [SecsToHMS.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/SecsToHMS.java) | +| 2 | [CelciusToFahrenheit.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/CelciusToFahrenheit.java) | 7 | [DistanceBetweenPoints.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/DistanceBetweenPoints.java) | +| 3 | [EnergyToHeatWater.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/EnergyToHeatWater.java) | 8 | [PythagoreanTheorem.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/PythagoreanTheorem.java) | +| 4 | [Investment.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/Investment.java) | 9 | [Countdown.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/Countdown.java) | +| 5 | [AverageSpeed.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/AverageSpeed.java) | 10 | [RealNumbers.java](https://github.com/TiagoRG/uaveiro-leci/blob/master/1ano/2semestre/poo/src/aula02/RealNumbers.java) | + --- *Pode conter erros, caso encontre algum, crie um* [*ticket*](https://github.com/TiagoRG/uaveiro-leci/issues/new) diff --git a/1ano/2semestre/poo/src/utils/UserInput.java b/1ano/2semestre/poo/src/utils/UserInput.java index 6aa8238..17ba119 100644 --- a/1ano/2semestre/poo/src/utils/UserInput.java +++ b/1ano/2semestre/poo/src/utils/UserInput.java @@ -3,6 +3,11 @@ package utils; import java.util.Scanner; public class UserInput { + public static String input(Scanner sin, String message) { + System.out.print(message); + return sin.next(); + } + public static double getNumberBetween(Scanner sin, double min, double max) { double input; do {