Advertisement
Mariusz94

Untitled

Sep 20th, 2018
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.90 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Lobby {
  4. // Aplikacja zawiera błąd, otóż nie wiedzieć czemu ale przy wyborze - Utoya/Skanska i wybraniu płatności (może być cash i cc) od razu wyskakuje opis ostatniego produktu; Copenhagen.
  5. public static void main(String[] args) {
  6. Scanner input = new Scanner(System.in);
  7. String powitanie = "Hello in Aeki shop, please, take a look at our furniture: ";
  8. int[] sizes = new int[4];
  9. sizes[0] = 100;
  10. sizes[1] = 200;
  11. sizes[2] = 50;
  12. sizes[3] = 75;
  13. int[] prices = new int[3];
  14. prices[0] = 500;
  15. prices[1] = 200;
  16. prices[2] = 800;
  17. String nazwy = ("\nYou can get one of these; we have a desk 'Utoya', a traditional table 'Skanska', and a little coffee table 'Copenhagen', \nand if you want to check a detailed info about them, please, type a name of it (big letter needs to be a big letter, don't forget it!");
  18. String czwarta = "\nPlease, type a name of one of our products: ";
  19. System.out.print(powitanie + nazwy + czwarta);
  20. String com1 = input.nextLine();
  21. switch (com1) {
  22. case "Utoya":
  23. System.out.println("It's a regular office desk, no shelfs and any gadgets like this, simpliest desk which you may imagine");
  24. System.out.print("\nSize: " + sizes[2] + "x" + sizes[0] + "x" + sizes[3] + " centimeters" + "\n cost: " + prices[2] + " PLN");
  25. Scanner input2 = new Scanner(System.in);
  26. System.out.println("\nSo, would you like to pay by cash or credit card?");
  27. String com2 = input2.nextLine();
  28. switch (com2) {
  29. case "credit card":
  30. Scanner input5 = new Scanner(System.in);
  31. System.out.println("Wonderfull, it will be: " + prices[2] + "\nwould you like to buy something else?");
  32. String com5 = input5.nextLine();
  33. switch(com5) {
  34. case "yes":
  35. System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
  36. break;
  37. case "no":
  38. System.out.println("Thank you, and have a nice day to You! :)");
  39. break;
  40. }
  41. break;
  42. case "cash":
  43. System.out.println("It will be: " + prices[2] + " PLN please");
  44. Scanner input6 = new Scanner(System.in);
  45. System.out.println("\n would you like to buy something else?");
  46. String com6 = input6.nextLine();
  47. switch(com6) {
  48. case "yes":
  49. System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
  50. break;
  51. case "no":
  52. System.out.println("Thank you, and have a nice day to You! :)");
  53. break;
  54. }
  55. break;
  56. default:
  57. System.out.println("just write: 'credit card' or 'cash' is this so hard?");
  58. break;
  59. }
  60. break;
  61. case "Skanska":
  62. System.out.println("\n\nKitchen table made in Taiwan");
  63. System.out.print("\nSize: " + sizes[2] + "x" + sizes[1] + "x" + sizes[3] + " centimeters" + "\n cost: " + prices[0] + " PLN");
  64. Scanner input3 = new Scanner(System.in);
  65. System.out.println("\nSo, would you like to pay by cash or credit card?");
  66. String com3 = input3.nextLine();
  67. switch (com3) {
  68. case "credit card":
  69. Scanner input7 = new Scanner (System.in);
  70. System.out.println("Wonderfull, it will be: " + prices[0] + "\nwould you like to buy something else?(yes / no): ");
  71. String com7 = input7.nextLine();
  72. switch(com7) {
  73. case "yes":
  74. System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
  75. break;
  76. case "no":
  77. System.out.println("Thank you, and have a nice day to You! :)");
  78. break;
  79. }
  80. case "cash":
  81. Scanner input8 = new Scanner(System.in);
  82. System.out.println("Wonderfull, it will be: " + prices[0] + "\nwould you like to buy something else?(yes / no): ");
  83. String com8 = input8.nextLine();
  84. switch(com8) {
  85. case "yes":
  86. System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
  87. break;
  88. case "no":
  89. System.out.println("Thank you, and have a nice day to You! :)");
  90. break;
  91. }
  92.  
  93.  
  94. case "Copenhagen" :
  95. System.out.println("And this is one of our smallest products, it gives you an opportunity to keep your book near your head during sleep");
  96. System.out.print("\nSize: " + sizes[2] + "x" + sizes[2] + "x" + sizes[2] + " centimeters" + "\n cost: " + prices[1] + " PLN");
  97. Scanner input4 = new Scanner(System.in);
  98. System.out.println("\nSo, would you like to pay by cash or credit card?");
  99. String com4 = input4.nextLine();
  100. switch (com4) {
  101. case "credit card":
  102. Scanner input9 = new Scanner(System.in);
  103. System.out.println("Wonderfull, it will be: " + prices[1] + "\nwould you like to buy something else?(yes / no): ");
  104. String com9 = input9.nextLine();
  105. switch(com9) {
  106. case "yes":
  107. System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
  108. break;
  109. case "no":
  110. System.out.println("Thank you, and have a nice day to You! :)");
  111. break;
  112. }
  113. break;
  114. case "cash":
  115. Scanner input10 = new Scanner(System.in);
  116. System.out.println("Wonderfull, it will be: " + prices[1] + "\nwould you like to buy something else?(yes / no): ");
  117. String com10 = input10.nextLine();
  118. switch(com10) {
  119. case "yes":
  120. System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
  121. break;
  122. case "no":
  123. System.out.println("Thank you, and have a nice day to You! :)");
  124. break;
  125. }
  126. break;
  127. default:
  128. System.out.println("just write: 'credit card' or 'cash' is this so hard?");
  129. break;
  130. }
  131. break;
  132. default:
  133. System.out.println("Please, literally rewire letter by letter the name of a product: ");
  134. break;
  135.  
  136. }
  137.  
  138.  
  139. }
  140. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement