Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.49 KB | None | 0 0
  1. package jan25lec;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class fruit {
  6. public static void main(String[] args) {
  7. Scanner scan = new Scanner(System.in);
  8. String input = scan.nextLine();
  9.  
  10. boolean isFruit = input.equals("apple") || input.equals("banana") || input.equals("lemon") || input.equals("kiwi") || input.equals("grapes");
  11. boolean isVegetable = input.equals("cucumber") || input.equals("pepper") || input.equals("carrot");
  12.  
  13. if (isFruit) {
  14. System.out.println("Fruit");
  15. }else if (isVegetable) {
  16. System.out.println("Vegetable");
  17. } else
  18. System.out.println("Unknown");
  19. }
  20. }
  21. package jan25lec;
  22.  
  23. import java.util.Scanner;
  24.  
  25. //public class lab11 {
  26. // public static void main(String[] args) {
  27. // Scanner scanner = new Scanner(System.in);
  28. //
  29. // int daysCount = Integer.parseInt(scanner.nextLine());
  30. // String roomType = scanner.nextLine();
  31. // String feedback = scanner.nextLine();
  32. //
  33. // int nightsCount = daysCount - 1;
  34. // double price = 0;
  35. //
  36. // switch (roomType) {
  37. // case "room for 1 person"
  38. // price = 18;
  39. // break;
  40. // case "apartment"
  41. // price = 25;
  42. // if (nightsCount < 10) {
  43. // price = price * 0.7;
  44. // }else if (nightsCount < 15) {
  45. // price = price * 0.65;
  46. // }else
  47. // price = price * 0.5;
  48. // case "president suite"
  49. // price = 35;
  50. // if (nightsCount < 10) {
  51. // price = price * 0.9;
  52. // }else if (nightsCount < 15) {
  53. // //not finished
  54. // }
  55. //
  56. // double totalPrice = price * nightsCount;
  57. // if (feedback.equals("positive")) {
  58. // totalPrice = price * nightsCount;
  59. // }
  60. // }
  61. // }
  62. //}
  63.  
  64. package jan26upr;
  65.  
  66. import java.util.Scanner;
  67.  
  68. public class upr1 {
  69. public static void main(String[] args) {
  70. Scanner scanner = new Scanner(System.in);
  71. double x1 = Double.parseDouble(scanner.nextLine());
  72. double y1 = Double.parseDouble(scanner.nextLine());
  73. double x2 = Double.parseDouble(scanner.nextLine());
  74. double y2 = Double.parseDouble(scanner.nextLine());
  75. double x = Double.parseDouble(scanner.nextLine());
  76. double y = Double.parseDouble(scanner.nextLine());
  77.  
  78. boolean firstCondition = false;
  79. boolean secondCondition = false;
  80.  
  81. if ((x == x1) || (x == x2) && (y >= y1) && (y <= y2)) {
  82. firstCondition = true;
  83. }else if (((y == x1) || (y == x2) && (y >= y1) && (y <= y2))) {
  84. secondCondition = true;
  85. }
  86.  
  87. if (firstCondition || secondCondition) {
  88. System.out.println("Border");
  89. }else {
  90. System.out.println("Inside/Outside");
  91. }
  92. }
  93. }
  94.  
  95.  
  96. package jan26upr;
  97.  
  98. import java.util.Scanner;
  99.  
  100. public class kino {
  101. public static void main(String[] args) {
  102. Scanner scanner = new Scanner(System.in);
  103.  
  104. String type = scanner.nextLine();
  105. int rows = Integer.parseInt(scanner.nextLine());
  106. int columns = Integer.parseInt(scanner.nextLine());
  107.  
  108. double revenue = 0;
  109.  
  110. if (type.equals("Premiere")) {
  111. revenue = rows * columns * 12;
  112. }else if (type.equals("Normal")) {
  113. revenue = rows * columns * 7.5;
  114. }else if (type.equals("Discount")) {
  115. revenue = rows * columns * 5;
  116. }
  117. System.out.printf("%.2f leva", revenue);
  118.  
  119. }
  120. }
  121.  
  122. package jan26upr;
  123.  
  124. import java.util.Scanner;
  125.  
  126. public class summerclothes {
  127. public static void main(String[] args) {
  128. Scanner scanner = new Scanner(System.in);
  129.  
  130. int degrees = Integer.parseInt(scanner.nextLine());
  131. String timeOfDay = scanner.nextLine();
  132.  
  133. String outfit = "None";
  134. String shoes = "None";
  135.  
  136. if ((degrees >= 10 && degrees <= 18)) {
  137. if (timeOfDay.equals("Morning")) {
  138. outfit = "Sweatshirt";
  139. shoes = "Sneakers";
  140. }else if (timeOfDay.equals("Afternoon")) {
  141. outfit = "Shirt";
  142. shoes = "Mocassins";
  143. }else if (timeOfDay.equals("Evening"))
  144. outfit = "Shirt";
  145. shoes = "Mocassins";
  146. }
  147. if ((degrees > 18 && degrees <= 24)) {
  148. if (timeOfDay.equals("Morning")) {
  149. outfit = "Shirt";
  150. shoes = "Mocassins";
  151. }else if (timeOfDay.equals("Afternoon")) {
  152. outfit = "T-Shirt";
  153. shoes = "Sandals";
  154. }else if (timeOfDay.equals("Evening"))
  155. outfit = "Shirt";
  156. shoes = "Mocassins";
  157. }
  158. if ((degrees >= 25)) {
  159. if (timeOfDay.equals("Morning")) {
  160. outfit = "T-Shirt";
  161. shoes = "Sandals";
  162. }else if (timeOfDay.equals("Afternoon")) {
  163. outfit = "Swim suit";
  164. shoes = "Barefoot";
  165. }else if (timeOfDay.equals("Evening"))
  166. outfit = "Shirt";
  167. shoes = "Mocassins";
  168. }
  169. System.out.printf("It's %d degrees, get your %s and %s.", degrees, outfit, shoes);
  170. }
  171. }
  172.  
  173. package jan26upr;
  174.  
  175. import java.util.Scanner;
  176.  
  177. public class summerclothes {
  178. public static void main(String[] args) {
  179. Scanner scanner = new Scanner(System.in);
  180.  
  181. int degrees = Integer.parseInt(scanner.nextLine());
  182. String timeOfDay = scanner.nextLine();
  183.  
  184. String outfit = "None";
  185. String shoes = "None";
  186.  
  187. if ((degrees >= 10 && degrees <= 18)) {
  188. if (timeOfDay.equals("Morning")) {
  189. outfit = "Sweatshirt";
  190. shoes = "Sneakers";
  191. }else if (timeOfDay.equals("Afternoon")) {
  192. outfit = "Shirt";
  193. shoes = "Mocassins";
  194. }else if (timeOfDay.equals("Evening"))
  195. outfit = "Shirt";
  196. shoes = "Mocassins";
  197. }
  198. if ((degrees > 18 && degrees <= 24)) {
  199. if (timeOfDay.equals("Morning")) {
  200. outfit = "Shirt";
  201. shoes = "Mocassins";
  202. }else if (timeOfDay.equals("Afternoon")) {
  203. outfit = "T-Shirt";
  204. shoes = "Sandals";
  205. }else if (timeOfDay.equals("Evening"))
  206. outfit = "Shirt";
  207. shoes = "Mocassins";
  208. }
  209. if ((degrees >= 25)) {
  210. if (timeOfDay.equals("Morning")) {
  211. outfit = "T-Shirt";
  212. shoes = "Sandals";
  213. }else if (timeOfDay.equals("Afternoon")) {
  214. outfit = "Swim suit";
  215. shoes = "Barefoot";
  216. }else if (timeOfDay.equals("Evening"))
  217. outfit = "Shirt";
  218. shoes = "Mocassins";
  219. }
  220. System.out.printf("It's %d degrees, get your %s and %s.", degrees, outfit, shoes);
  221. }
  222. }
  223.  
  224. package jan25lec;
  225.  
  226. import java.util.Scanner;
  227.  
  228. public class numberinrange {
  229. public static void main(String[] args) {
  230. Scanner scan = new Scanner(System.in);
  231. int number = Integer.parseInt(scan.nextLine());
  232. boolean isTrue = number >= -100 && number < 100 && number !=0;
  233. if (isTrue)
  234. System.out.println("Yes");
  235. else
  236. System.out.println("No");
  237. }
  238. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement