Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class BlueJack {
- public static void main(String[] args) {
- boolean success = false;
- int min = 100000;
- int max = 3000000;
- int money;
- Scanner in = new Scanner(System.in);
- System.out.println("BlueJack Money Storage");
- System.out.println("======================\n");
- do {
- System.out.printf("Input the amount of money you have [%d..%d] : ", min, max);
- if (in.hasNextInt()) {
- money = in.nextInt();
- if (money >= min && money <= max) {
- success = true;
- } else {
- System.out.printf("Amount of money which inputed is between %d and %d\n\n", min, max);
- in.nextLine();
- }
- } else {
- System.out.println("Input is only number\n");
- in.nextLine();
- }
- } while (!success);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment