Project1.txt - import java.lang.Math import...

This preview shows page 1 - 2 out of 3 pages.

import java.lang.Math; import java.util.Scanner; public class CaptureCalculator { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Hello and welcome to the Monster Capture Possibility Calculator: "); System.out.print("Please enter the latitude of the monster (1-10): "); int monLat = input.nextInt(); System.out.print("Please enter the longitude of the monster (1-10): "); int monLong = input.nextInt(); System.out.print("Please enter the time of the monster appear (1- 1440): "); int Ta = input.nextInt(); System.out.print("Please enter the possible time of the monster will exist (10-59): "); int Te = input.nextInt(); System.out.print("Please enter the player s ID (8 digits): "); String playerID = input.next(); int digits = Integer.parseInt(playerID.substring(6)); boolean lucky = false; if (digits >= 50 && digits <= 99) { lucky = false; int minVal, a=50, b=99; minVal = (digits >= 50 && digits <= 99) ? 50 : 99; System.out.println("You are on the normal list"); } if (digits >= 0 && digits <= 49) { lucky = true; int minVal, c=0, d=49; minVal = (digits >= 0 && digits <= 49) ? 0 : 49; System.out.println("You are on the lucky list");

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture