HarryJW

Untitled

Jan 7th, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. package javaShop;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Shop {
  6.  
  7.  
  8.  
  9. public static void main (String [] args){
  10.  
  11. int brokenComputer = 40;
  12. int cookie = 3;
  13. int unknownVideoGame = 25;
  14. int modernArt = 80;
  15. int uselessButton = 10;
  16.  
  17. int brokenComputerAmount = 0;
  18. int cookieAmount = 0;
  19. int unknownVideoGameAmount = 0;
  20. int modernArtAmount = 0;
  21. int uselessButtonAmount = 0;
  22.  
  23. int brokenComputerAdding = 0;
  24. int cookieAdding = 0;
  25. int unknownVideoGameAdding = 0;
  26. int modernArtAdding = 0;
  27. int uselessButtonAdding = 0;
  28.  
  29. String[] menu;
  30.  
  31. int itemsInBasket = 0;
  32.  
  33. int optionOne = 1;
  34. int optionTwo = 2;
  35. int optionThree = 3;
  36. int optionFour = 4;
  37. int optionFive = 5;
  38. int optionSix = 6;
  39.  
  40. int customersMoney = 100;
  41.  
  42. String basket = ("");
  43.  
  44. int userChoice = 0;
  45.  
  46.  
  47. Scanner userScanner = new Scanner (System.in);
  48. Scanner userAmount = new Scanner (System.in);
  49.  
  50. String whatNext = ("What would you like to do?");
  51.  
  52.  
  53. System.out.println("Hello Customer. You currently have" + " " + itemsInBasket + " " + "items in your basket");
  54. System.out.println("What would you like to do?");
  55. System.out.println("1) Add an item to your basket.");
  56. System.out.println("2) View your basket");
  57. System.out.println("3) Pay and exit");
  58. userChoice =userScanner.nextInt();
  59.  
  60. if (userChoice == (optionOne)){
  61.  
  62. System.out.println("What would you like to add to your basket?");
  63. System.out.println("1)Broken Computer $40");
  64. System.out.println("2)Cookie $3");
  65. System.out.println("3)Unknown Video Game $25");
  66. System.out.println("4)Modern Art $80");
  67. System.out.println("5)Useless Button $10");
  68. userChoice = userScanner.nextInt();
  69.  
  70. if (userChoice == (optionOne)){
  71.  
  72. System.out.println("How many Broken Computers would you like to add to your basket?");
  73. brokenComputerAdding = userAmount.nextInt();
  74. brokenComputerAmount = brokenComputerAmount + brokenComputerAdding;
  75. System.out.println("You now have" + " " + (brokenComputerAmount) + " " + "Broken Computer's in your basket.");
  76. System.out.print(whatNext);
  77. System.out.println("1) Go Back");
  78. userChoice = userScanner.nextInt();
  79. if (userChoice == (optionOne)){
  80.  
  81. return;
  82.  
  83. }
  84.  
  85. }
  86.  
  87.  
  88. }
  89.  
  90.  
  91.  
  92.  
  93. }
  94.  
  95.  
  96.  
  97. }
Advertisement
Add Comment
Please, Sign In to add comment