ventsislav83

Game

Jun 8th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.32 KB | None | 0 0
  1. package loopsForDraw;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class games_p_04 {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scan = new Scanner(System.in);
  10.  
  11.         int num = Integer.parseInt(scan.nextLine());
  12.  
  13.  
  14.         double firstSelector = 0;
  15.         double secondSelector = 0;
  16.         double thirtSelector = 0;
  17.         double fourtySelector = 0;
  18.         double fiveSelector = 0;
  19.         double higetsOrLower = 0;
  20.  
  21.  
  22.         for (int i = 0; i < num; i++) {
  23.             int currentNum = Integer.parseInt(scan.nextLine());
  24.  
  25.  
  26.             if (currentNum >= 0 && currentNum <= 9) {
  27.                 firstSelector = currentNum * 0.2;
  28.             } else if (currentNum >= 10 && currentNum <= 19) {
  29.                 secondSelector = currentNum * 0.3;
  30.             } else if (currentNum >= 20 && currentNum <= 29) {
  31.  
  32.                 thirtSelector = currentNum * 0.4;
  33.             } else if (currentNum >= 30 && currentNum <= 39) {
  34.                 fourtySelector = currentNum + 50;
  35.  
  36.             } else if (currentNum >= 40 && currentNum < 50) {
  37.                 firstSelector = currentNum + 100;
  38.  
  39.             } else if (currentNum < 0 && currentNum >= 50) {
  40.  
  41.                 higetsOrLower = currentNum * (100 / 2);
  42.  
  43.             }
  44.  
  45.  
  46.         }
  47.  
  48.         System.out.println(firstSelector);
  49.     }
  50.  
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment