Facebook
From Scorching Panda, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 330
  1. import java.util.Map;
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String[] args) {
  7.  
  8.         //deklaracja wszystkich zmiennych
  9.         Scanner scanner = new Scanner(System.in);
  10.         String singleChoice;
  11.         boolean correctInput = false;
  12.         boolean pozaGranice = false;
  13.         boolean niskieKoszty = false;
  14.         boolean iloscLadunku = false;
  15.         boolean szybkosc = false;
  16.         String rodzajLadunku = "";
  17.  
  18.         //pierwszy wybor
  19.         System.out.println("Czy chcesz przewiezc ladunek poza granice kraju? (Tak)/(Nie)");
  20.         //jesli tak, to wybor jest umieszczany hashmapie jako 1,
  21.         // czyli dla klucza o wartosci w tym przypadku 0 przypisywanie jest 1.
  22.         //Analogicznie dla przypadku kiedy wybor jest nie
  23.         while(correctInput == false) {
  24.             singleChoice = scanner.next();
  25.             if (singleChoice.equals("Tak")) {
  26.                 pozaGranice = true;
  27.                 correctInput = true;
  28.             } else if (singleChoice.equals("Nie")) {
  29.                 pozaGranice = false;
  30.                 correctInput = true;
  31.             }
  32.             if(correctInput == false) {
  33.                 System.out.println("Niepoprawnie wpisana odpowiedz, sproboj ponownie");
  34.             }
  35.         }
  36.         //resetowanie zmiennej idioto-odpornej, analogicznie dalej
  37.         correctInput = false;
  38.  
  39.         System.out.println("Czy zalezy Ci na niskich kosztach? (Tak)/(Nie)");
  40.         while(correctInput == false) {
  41.             singleChoice = scanner.next();
  42.             if (singleChoice.equals("Tak")) {
  43.                 niskieKoszty = true;
  44.                 correctInput = true;
  45.             } else if (singleChoice.equals("Nie")) {
  46.                 niskieKoszty = false;
  47.                 correctInput = true;
  48.             }
  49.             if(correctInput == false) {
  50.                 System.out.println("Niepoprawnie wpisana odpowiedz, sproboj ponownie");
  51.             }
  52.         }
  53.         correctInput = false;
  54.  
  55.         System.out.println("Czy chcesz przewiezc mala ilosc ladunku? (Tak)/(Nie)");
  56.         while(correctInput == false) {
  57.             singleChoice = scanner.next();
  58.             if (singleChoice.equals("Tak")) {
  59.                 iloscLadunku = true;
  60.                 correctInput = true;
  61.             } else if (singleChoice.equals("Nie")) {
  62.                 iloscLadunku = false;
  63.                 correctInput = true;
  64.             }
  65.             if(correctInput == false) {
  66.                 System.out.println("Niepoprawnie wpisana odpowiedz, sproboj ponownie");
  67.             }
  68.         }
  69.         correctInput = false;
  70.  
  71.         System.out.println("Czy zalezy Ci na szybkosci? (Tak)/(Nie)");
  72.         while(correctInput == false) {
  73.             singleChoice = scanner.next();
  74.             if (singleChoice.equals("Tak")) {
  75.                 szybkosc = true;
  76.                 correctInput = true;
  77.             } else if (singleChoice.equals("Nie")) {
  78.                 szybkosc = false;
  79.                 correctInput = true;
  80.             }
  81.             if(correctInput == false) {
  82.                 System.out.println("Niepoprawnie wpisana odpowiedz, sproboj ponownie");
  83.             }
  84.         }
  85.         correctInput = false;
  86.  
  87.         System.out.println("Wybierz rodzaj ładunku:");
  88.         System.out.println("Ponadgabarytowy (P),");
  89.         System.out.println("Niebiezpieczny (ADR),");
  90.         System.out.println("Normalny (N)");
  91.         while(correctInput == false) {
  92.             singleChoice = scanner.next();
  93.             if (singleChoice.equals("P")) {
  94.                 rodzajLadunku = "P";
  95.                 correctInput = true;
  96.             } else if (singleChoice.equals("ADR")) {
  97.                 rodzajLadunku = "ADR";
  98.                 correctInput = true;
  99.             } else if (singleChoice.equals("N")) {
  100.                 rodzajLadunku = "N";
  101.                 correctInput = true;
  102.             }
  103.             if (correctInput == false) {
  104.                 System.out.println("Niepoprawnie wpisana odpowiedz, sproboj ponownie");
  105.             }
  106.         }
  107.  
  108.  
  109.         //dokonywanie wyboru przewoznika
  110.  
  111.  
  112.         //NIESTETY MUSISZ PRZEROBIC KAZDY NASTEPNY IF W TEN SPOSOB JAK WYGLADA TEN :(
  113.         if(pozaGranice == true && niskieKoszty == true && iloscLadunku == true
  114.                 && szybkosc == true && rodzajLadunku.equals("P"))
  115.             System.out.println("Hecksher Polska z o. o.");
  116.         //-------------------------------------------------------------------
  117.  
  118.  
  119.  
  120.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(1)
  121.                 && choice.get(3).equals(1) && choice.get(4).equals(1))
  122.             System.out.println("Prezydent Polska");
  123.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(1)
  124.                 && choice.get(3).equals(1) && choice.get(4).equals(2))
  125.             System.out.println("SPEDCOM Sp. Z o. o. Spółka Cywilna");
  126.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(1)
  127.                 && choice.get(3).equals(0) && choice.get(4).equals(0))
  128.             System.out.println("Prezydent Polska");
  129.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(1)
  130.                 && choice.get(3).equals(0) && choice.get(4).equals(1))
  131.             System.out.println("Rabell Logistics");
  132.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(1)
  133.                 && choice.get(3).equals(0) && choice.get(4).equals(2))
  134.             System.out.println("Aquarius Gem Shipping Gabriela Szemrowicz");
  135.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(0)
  136.                 && choice.get(3).equals(1) && choice.get(4).equals(0))
  137.             System.out.println("Ewals Cargo Polska");
  138.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(0)
  139.                 && choice.get(3).equals(1) && choice.get(4).equals(1))
  140.             System.out.println("Prezydent Polska");
  141.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(0)
  142.                 && choice.get(3).equals(1) && choice.get(4).equals(2))
  143.             System.out.println("AutoAndreas");
  144.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(0)
  145.                 && choice.get(3).equals(0) && choice.get(4).equals(0))
  146.             System.out.println("Heckscher Polska z o. o.");
  147.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(0)
  148.                 && choice.get(3).equals(0) && choice.get(4).equals(1))
  149.             System.out.println("Ewals Cargo Polska");
  150.         else if(choice.get(0).equals(1) && choice.get(1).equals(1) && choice.get(2).equals(0)
  151.                 && choice.get(3).equals(0) && choice.get(4).equals(2))
  152.             System.out.println("Apak Logistics");
  153.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(1)
  154.                 && choice.get(3).equals(1) && choice.get(4).equals(0))
  155.             System.out.println("Heckscher Polska z o. o.");
  156.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(1)
  157.                 && choice.get(3).equals(1) && choice.get(4).equals(1))
  158.             System.out.println("A. Jezerski Sp. Z o. o.");
  159.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(1)
  160.                 && choice.get(3).equals(1) && choice.get(4).equals(2))
  161.             System.out.println("SPEDCOM Sp. Z o. o. Spółka Cywilna");
  162.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(1)
  163.                 && choice.get(3).equals(0) && choice.get(4).equals(0))
  164.             System.out.println("Aquarius Gem Shipping Gabriela Szemrowicz");
  165.         if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(1)
  166.                 && choice.get(3).equals(0) && choice.get(4).equals(1))
  167.             System.out.println("Prezydent Polska");
  168.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(1)
  169.                 && choice.get(3).equals(0) && choice.get(4).equals(2))
  170.             System.out.println("Ecu-Line Polska Sp. Z o. o.");
  171.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(0)
  172.                 && choice.get(3).equals(1) && choice.get(4).equals(0))
  173.             System.out.println("Bastaga S.C.");
  174.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(0)
  175.                 && choice.get(3).equals(1) && choice.get(4).equals(1))
  176.             System.out.println("Ewals Cargo Polska");
  177.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(0)
  178.                 && choice.get(3).equals(1) && choice.get(4).equals(2))
  179.             System.out.println("AutoAndreas");
  180.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(0)
  181.                 && choice.get(3).equals(0) && choice.get(4).equals(0))
  182.             System.out.println("Hecksher Polska z o. o.");
  183.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(0)
  184.                 && choice.get(3).equals(0) && choice.get(4).equals(1))
  185.             System.out.println("Prezydent Polska");
  186.         else if(choice.get(0).equals(1) && choice.get(1).equals(0) && choice.get(2).equals(0)
  187.                 && choice.get(3).equals(0) && choice.get(4).equals(2))
  188.             System.out.println("Auarius Gem Shipping Gabriela Szemrowicz");
  189.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(1)
  190.                 && choice.get(3).equals(1) && choice.get(4).equals(0))
  191.             System.out.println("Hecksher Polska z o. o.");
  192.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(1)
  193.                 && choice.get(3).equals(1) && choice.get(4).equals(1))
  194.             System.out.println("Prezydent Polska");
  195.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(1)
  196.                 && choice.get(3).equals(1) && choice.get(4).equals(2))
  197.             System.out.println("SPEDCOM Sp. Z o. o. Spółka Cywilna");
  198.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(1)
  199.                 && choice.get(3).equals(0) && choice.get(4).equals(0))
  200.             System.out.println("Prezydent Polska");
  201.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(1)
  202.                 && choice.get(3).equals(0) && choice.get(4).equals(1))
  203.             System.out.println("Ewals Cargo Polska");
  204.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(1)
  205.                 && choice.get(3).equals(0) && choice.get(4).equals(2))
  206.             System.out.println("Ecu-Line Polska Sp. Z o. o.");
  207.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(0)
  208.                 && choice.get(3).equals(1) && choice.get(4).equals(0))
  209.             System.out.println("MIR_TRANS Mirosław Staniszewski");
  210.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(0)
  211.                 && choice.get(3).equals(1) && choice.get(4).equals(1))
  212.             System.out.println("Rabell Logistics");
  213.         if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(0)
  214.                 && choice.get(3).equals(1) && choice.get(4).equals(2))
  215.             System.out.println("SPEDCOM Sp. Z o. o. Spółka Cywilna");
  216.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(0)
  217.                 && choice.get(3).equals(0) && choice.get(4).equals(0))
  218.             System.out.println("MIR_TRANS Mirosław Staniszewski");
  219.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(0)
  220.                 && choice.get(3).equals(0) && choice.get(4).equals(1))
  221.             System.out.println("A. Jezerski Sp. Z o. o.");
  222.         else if(choice.get(0).equals(0) && choice.get(1).equals(1) && choice.get(2).equals(0)
  223.                 && choice.get(3).equals(0) && choice.get(4).equals(2))
  224.             System.out.println("Bastaga S.C");
  225.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(1)
  226.                 && choice.get(3).equals(1) && choice.get(4).equals(0))
  227.             System.out.println("GH Spedition Sp. Z o. o.");
  228.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(1)
  229.                 && choice.get(3).equals(1) && choice.get(4).equals(1))
  230.             System.out.println("Wichot Transport");
  231.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(1)
  232.                 && choice.get(3).equals(1) && choice.get(4).equals(2))
  233.             System.out.println("SPEDCOM Sp. Z o. o. Spółka Cywilna");
  234.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(1)
  235.                 && choice.get(3).equals(0) && choice.get(4).equals(0))
  236.             System.out.println("MIR_TRANS Mirosław Staniszewski");
  237.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(1)
  238.                 && choice.get(3).equals(0) && choice.get(4).equals(1))
  239.             System.out.println("A. Jezerski Sp. Z o. o.");
  240.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(1)
  241.                 && choice.get(3).equals(0) && choice.get(4).equals(2))
  242.             System.out.println("Ecu-Line Polska Sp. Z o. o.");
  243.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(0)
  244.                 && choice.get(3).equals(1) && choice.get(4).equals(0))
  245.             System.out.println("Rabell Logistics");
  246.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(0)
  247.                 && choice.get(3).equals(1) && choice.get(4).equals(1))
  248.             System.out.println("GH Spedition Sp. Z o. o.");
  249.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(0)
  250.                 && choice.get(3).equals(1) && choice.get(4).equals(2))
  251.             System.out.println("Apak Logistics");
  252.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(0)
  253.                 && choice.get(3).equals(0) && choice.get(4).equals(0))
  254.             System.out.println("Rabell Logistics");
  255.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(0)
  256.                 && choice.get(3).equals(0) && choice.get(4).equals(1))
  257.             System.out.println("Wichot Transport");
  258.         else if(choice.get(0).equals(0) && choice.get(1).equals(0) && choice.get(2).equals(0)
  259.                 && choice.get(3).equals(0) && choice.get(4).equals(2))
  260.             System.out.println("Bastaga S.C.");
  261.     }
  262. }
  263.