Category Archives: Java

Java CurrencyTranslator

Program shows the exchange rate (Doesn’t show real rates) for a requested sum between euros and USD. Edit: Testing GitHub Gists Old: import java.util.Scanner; public class CurrencyTranslator { Scanner reader=new Scanner(System.in); boolean repeat=true; double euroTOdollar=1.18;//€->$ rate double dollarTOeuro=0.85;//$->€ rate private void run(){ System.out.println(“*******************\nCurrency translator 1.0”); while(repeat){ int requestedOperation=getOperation();//euro->dollar or dollar->euro or exit executeRequestedOperation(requestedOperation); } }… Read More »

Java NumberTable

Program asks you to enter 10 numbers and lists them from biggest to smallest. After the list is shown, the program asks if you would like to check for a specific number from the list. import java.util.Scanner; public class NumberTable { Scanner numberReader=new Scanner(System.in); Scanner textReader=new Scanner(System.in); double[] numbers=new double[10]; private void run(){ getNumbers(); arrangeNumbers();… Read More »