import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter an integer: "); int number = input.nextInt(); int mask = 1; for(int i = 15; i > 0; i--)…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the number of second: "); int countDown = input.nextInt(); input.close(); long startTime =…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a commission sought: "); int commissionSought = input.nextInt(); input.close(); double sum…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter numbers: "); int max = 0; int count = 0; int number; while(true) { number = input.nextInt(…
public class Solution { public static void main(String[] args) { long positiveSide = 0; long negativeSide = 0; int side; for(long i = 0; i < 1000000; i++) { side = (int)(Math.random() * 2); if(side == 1) positiveSide++; else negativeSide++; } System.…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter an integer: "); int number = input.nextInt(); input.close(); String[] charOfNumber = {&quo…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the integer: "); int number = input.nextInt(); input.close(); String binaryString = "…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the ISBN: "); String isbn = input.nextLine(); input.close(); int numberOfISDN = Integer.pa…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter your lottery pick (two digits): "); int guess = input.nextInt(); int lottery = (int)(Math.…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the number of students: "); int numberOfStudents = input.nextInt(); int score = 0; int max…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the number of students: "); int numberOfStudents = input.nextInt(); int score = 0; int max…
public class Solution { public static void main(String[] args) { final double POUND_PER_KILOGRAM = 2.2; System.out.println("KILOGRAM" + "\t" + "POUND"); for(int i = 1; i < 200; i += 2) System.out.println(i + "\t"…
public class Solution { public static void main(String[] args) { final double KILOMETERS_PER_MILE = 1.609; System.out.println("Miles"+ "\t" + "Kilometers"); for(int i = 1; i <= 10; i++) System.out.println(i + "\t"…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); int correctCount = 0; int answer = 0; int number1; int number2; long startTime = System.currentTimeMillis(); for(int i…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter an int value, the program exits if the input is 0: "); int inputValue = input.nextInt(); i…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the balance: "); double balance = input.nextDouble(); System.out.print("Enter the ann…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the year: "); int year = input.nextInt(); System.out.print("Enter the weekday of the…