Tag Archives: DoWhile

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 »

Java dice game

The program asks how much money you want to bet (amount of rounds) and throws three dice. If you get six once you win 1 euro, if twice 20 euros and if all three dice give a six you win 40 euros. DiceGame.java: import java.util.Scanner; import java.util.Random; public class DiceGame { Scanner reader=new Scanner(System.in); Random… Read More »