daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Dec 9th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int child;
  2. char gender;
  3. int temp;
  4. child=console.nextInt();
  5. gender=console.next().charat(0);
  6. if(gender=='m' && children>=4)
  7.   temp =1;
  8. else if(gender=='m' && children<4)
  9.   temp =2;
  10. else if(gender=='f' && children<4)
  11.   temp =3;
  12. else
  13.   temp=4;
  14. }
  15.    
  16. int children;
  17.     double temp;
  18.     char gender;
  19.     children=console.nextInt();
  20.     switch(children , gender )
  21.     {
  22.       case < 4, 'm':
  23.  
  24.         temp=1;
  25.       break;
  26.  
  27.       default : salary=600;
  28.     }
  29.    
  30. switch (gender) {
  31.     case 'm':
  32.         temp = 0;
  33.         if (children >= 4) {
  34.             temp += 1;
  35.         } else {
  36.             temp += 2;
  37.         }
  38.         break;
  39.     case 'f':
  40.         temp = 2;
  41.         if (children >= 4) {
  42.             temp += 2;
  43.         } else {
  44.             temp += 1;
  45.         }
  46.         break;
  47. }
  48.    
  49. switch (gender) {
  50.     case 'm':
  51.         temp = 0;
  52.         switch (children) {
  53.             case 0:
  54.             case 1:
  55.             case 2:
  56.             case 3:
  57.                 temp += 2;
  58.                 break;  
  59.             default:
  60.                 temp += 1;
  61.         }
  62.         break;
  63.     case 'f':
  64.         temp = 2;
  65.         switch (children) {
  66.             case 0:
  67.             case 1:
  68.             case 2:
  69.             case 3:
  70.                 temp += 1;
  71.                 break;
  72.             default:
  73.                 temp += 2;
  74.         }
  75.         break;
  76. }
  77.    
  78. case 'm':
  79.     temp = (children >= 4)? 1:2;
  80.     break;
  81. case 'f':
  82.     temp = (children >= 4)? 4:3;
  83.     break;
  84. default:
  85.     temp = 4;
  86.     break;
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