Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 6th, 2020 125 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Salary {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int tabCounts = Integer.parseInt(scanner.nextLine());
  8.         int salary = Integer.parseInt(scanner.nextLine());
  9.  
  10.         for (int i = 0; i > tabCounts; i++) {
  11.  
  12.             String site = scanner.nextLine();
  13.             switch (site) {
  14.                 case "Facebook":
  15.                     salary=salary-150;
  16.                     break;
  17.                 case "Instagram":
  18.                     salary=salary-100;
  19.                     break;
  20.                 case "Reddit":
  21.                     salary=salary-50;
  22.                     break;
  23.             }
  24.             if (salary <=0){
  25.                 System.out.println("You have lost your salary");
  26.                 break;
  27.             }
  28.         }
  29. if (salary>0){
  30.     System.out.println(salary);
  31. }
  32.  
  33.     }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top