Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaShop;
- import java.util.Scanner;
- public class Shop {
- public static void main (String [] args){
- int brokenComputer = 40;
- int cookie = 3;
- int unknownVideoGame = 25;
- int modernArt = 80;
- int uselessButton = 10;
- int brokenComputerAmount = 0;
- int cookieAmount = 0;
- int unknownVideoGameAmount = 0;
- int modernArtAmount = 0;
- int uselessButtonAmount = 0;
- int brokenComputerAdding = 0;
- int cookieAdding = 0;
- int unknownVideoGameAdding = 0;
- int modernArtAdding = 0;
- int uselessButtonAdding = 0;
- String[] menu;
- int itemsInBasket = 0;
- int optionOne = 1;
- int optionTwo = 2;
- int optionThree = 3;
- int optionFour = 4;
- int optionFive = 5;
- int optionSix = 6;
- int customersMoney = 100;
- String basket = ("");
- int userChoice = 0;
- Scanner userScanner = new Scanner (System.in);
- Scanner userAmount = new Scanner (System.in);
- String whatNext = ("What would you like to do?");
- System.out.println("Hello Customer. You currently have" + " " + itemsInBasket + " " + "items in your basket");
- System.out.println("What would you like to do?");
- System.out.println("1) Add an item to your basket.");
- System.out.println("2) View your basket");
- System.out.println("3) Pay and exit");
- userChoice =userScanner.nextInt();
- if (userChoice == (optionOne)){
- System.out.println("What would you like to add to your basket?");
- System.out.println("1)Broken Computer $40");
- System.out.println("2)Cookie $3");
- System.out.println("3)Unknown Video Game $25");
- System.out.println("4)Modern Art $80");
- System.out.println("5)Useless Button $10");
- userChoice = userScanner.nextInt();
- if (userChoice == (optionOne)){
- System.out.println("How many Broken Computers would you like to add to your basket?");
- brokenComputerAdding = userAmount.nextInt();
- brokenComputerAmount = brokenComputerAmount + brokenComputerAdding;
- System.out.println("You now have" + " " + (brokenComputerAmount) + " " + "Broken Computer's in your basket.");
- System.out.print(whatNext);
- System.out.println("1) Go Back");
- userChoice = userScanner.nextInt();
- if (userChoice == (optionOne)){
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment