Advertisement
TsetsoP

main

Oct 28th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.82 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class App {
  4.  
  5. public static void main(String[] args) {
  6. Scanner scan = new Scanner(System.in);
  7.  
  8. //System.out.print("Инструкция : винаги пишете първата буква на изречението главна.");
  9. System.out.print("\nКато какъв потребител искате да се впишете в системата?");
  10.  
  11. System.out.println("\n 1. Клиент\n 2. Служител\n 3. Искам да се кандидатирам");
  12. String input = scan.nextLine();
  13.  
  14. if (input.equals("1")) {//
  15.  
  16. System.out.println("Изберете:\n 1. Мъжко \n 2. Дамско");
  17. String desiredGender = scan.nextLine();
  18.  
  19. switch (desiredGender) { //Начало на switch
  20. case "1": //Старт на case 1 - за мъжко
  21. desiredGender = "мъжко";
  22. while (!input.equalsIgnoreCase("стоп")) {
  23. System.out.println(" 1. Търсене по вид " + "\n 2. Търсене по размер " + "\n 3. Търсене по бранд" + "\n 4. Търсене по цвят"
  24. + "\n 5. Търсене по цена" + "\n 6. Търсене по сезон" + "\n 7. Всичко");
  25. input = scan.nextLine();
  26. switch (input) { //Начало на switch - за 1,2,3,4...
  27. case "1":
  28. System.out.println("Какъв тип дрехи търсите?");
  29. String desiredType = scan.nextLine();
  30. Clothes.getClothesType(desiredType, desiredGender);
  31. break;
  32.  
  33. case "2":
  34. System.out.println("Какъв размер търсите?");
  35. String desiredSize = scan.nextLine();
  36. Clothes.getClothesSize(desiredSize, desiredGender);
  37. break;
  38.  
  39. case "3":
  40. System.out.println("Какъв бранд търсите?");
  41. String desiredBrand = scan.nextLine();
  42. Clothes.getClothesBrand(desiredBrand, desiredGender);
  43. break;
  44.  
  45. case "4":
  46. System.out.println("Какъв цвят търсите?");
  47. String desiredColor = scan.nextLine();
  48. Clothes.getClothesColor(desiredColor, desiredGender);
  49. break;
  50.  
  51. case "5":
  52. System.out.println("До каква цена търсите?");
  53. double desiredPrice = scan.nextDouble();
  54. Clothes.getClothesPrice(desiredPrice, desiredGender);
  55. break;
  56.  
  57. case "6":
  58. System.out.println("За кой сезон търсите?");
  59. String desiredSeason = scan.nextLine();
  60. Clothes.getClothesSeason(desiredSeason, desiredGender);
  61. break;
  62.  
  63. case "7":
  64. Clothes.getAllClothes(desiredGender);
  65. break;
  66.  
  67. default:
  68. System.out.println("Излязохте извън допустимите опции.");
  69. break;
  70.  
  71. }//Край на switch - за 1,2,3,4...
  72.  
  73. } // Край while
  74. break;
  75. case "2": //Начало на case 2 - за дамско
  76. desiredGender = "дамско";
  77. while (!input.equalsIgnoreCase("стоп")) { //Начало на while
  78. System.out.println(" 1. Търсене по вид " + "\n 2. Търсене по размер " + "\n 3. Търсене по бранд" + "\n 4. Търсене по цвят"
  79. + "\n 5. Търсене по цена" + "\n 6. Търсене по сезон" + "\n 7. Всичко");
  80. input = scan.nextLine();
  81. switch (input) { //Начало на switch - за 1,2,3,4...
  82. case "1":
  83. System.out.println("Какъв тип дрехи търсите?");
  84. String desiredType = scan.nextLine();
  85. Clothes.getClothesType(desiredType, desiredGender);
  86. break;
  87.  
  88. case "2":
  89. System.out.println("Какъв размер търсите?");
  90. String desiredSize = scan.nextLine();
  91. Clothes.getClothesSize(desiredSize, desiredGender);
  92. break;
  93.  
  94. case "3":
  95. System.out.println("Какъв бранд търсите?");
  96. String desiredBrand = scan.nextLine();
  97. Clothes.getClothesBrand(desiredBrand, desiredGender);
  98. break;
  99.  
  100. case "4":
  101. System.out.println("Какъв цвят търсите?");
  102. String desiredColor = scan.nextLine();
  103. Clothes.getClothesColor(desiredColor, desiredGender);
  104. break;
  105.  
  106. case "5":
  107. System.out.println("До каква цена търсите?");
  108. double desiredPrice = scan.nextDouble();
  109. Clothes.getClothesPrice(desiredPrice, desiredGender);
  110. break;
  111.  
  112. case "6":
  113. System.out.println("За кой сезон търсите?");
  114. String desiredSeason = scan.nextLine();
  115. Clothes.getClothesSeason(desiredSeason, desiredGender);
  116. break;
  117.  
  118. case "7":
  119. Clothes.getAllClothes(desiredGender);
  120. break;
  121.  
  122. default:
  123. System.out.println("Излязохте извън допустимите опции.");
  124. break;
  125.  
  126. }//Край на switch - за 1,2,3,4...
  127. }//Край на while
  128. }//Край на switch(desiredGender)
  129.  
  130.  
  131. }//Край на if
  132. else if (input.equals("2")) { //Служители - вход + промяна на цена
  133.  
  134.  
  135. System.out.println("Въведете вашето име");
  136. String name = scan.nextLine();
  137. System.out.println("Въведете вашата фамилия");
  138. String family = scan.nextLine();
  139. System.out.println("Въведете вашето ЕГН");
  140. String egn = scan.nextLine();
  141.  
  142. Employee.getEmployee(name, family, egn);
  143.  
  144.  
  145.  
  146. }
  147.  
  148. else if (input.equals("3")) { // Изисквания за кандидатстване
  149.  
  150. System.out.println("Изисквания : \nНавършени 19 години; \nПоне година стаж в тази сфера; \nОбразование над или на ниво 'Средно';\n");
  151.  
  152. System.out.println("Въведете вашето име");
  153. String name = scan.nextLine();
  154. System.out.println("Въведете вашата фамилия");
  155. String family = scan.nextLine();
  156. System.out.println("Въведете вашите години");
  157. int age = Integer.parseInt(scan.nextLine());
  158. System.out.println("Въведете вашето ЕГН");
  159. String egn = scan.nextLine();
  160. System.out.println("Въведете вашият опит");
  161. int experience = Integer.parseInt(scan.nextLine());
  162. System.out.println("Въведете вашето образование");
  163. String education = scan.nextLine();
  164.  
  165. Applications.getApplications(age, experience, education,egn);
  166.  
  167. }
  168. else{
  169. System.out.println("Излязохте извън допустимите опции.");
  170. }
  171.  
  172.  
  173. }
  174.  
  175. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement