Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Lobby {
- // 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.
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- String powitanie = "Hello in Aeki shop, please, take a look at our furniture: ";
- int[] sizes = new int[4];
- sizes[0] = 100;
- sizes[1] = 200;
- sizes[2] = 50;
- sizes[3] = 75;
- int[] prices = new int[3];
- prices[0] = 500;
- prices[1] = 200;
- prices[2] = 800;
- 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!");
- String czwarta = "\nPlease, type a name of one of our products: ";
- System.out.print(powitanie + nazwy + czwarta);
- String com1 = input.nextLine();
- switch (com1) {
- case "Utoya":
- System.out.println("It's a regular office desk, no shelfs and any gadgets like this, simpliest desk which you may imagine");
- System.out.print("\nSize: " + sizes[2] + "x" + sizes[0] + "x" + sizes[3] + " centimeters" + "\n cost: " + prices[2] + " PLN");
- Scanner input2 = new Scanner(System.in);
- System.out.println("\nSo, would you like to pay by cash or credit card?");
- String com2 = input2.nextLine();
- switch (com2) {
- case "credit card":
- Scanner input5 = new Scanner(System.in);
- System.out.println("Wonderfull, it will be: " + prices[2] + "\nwould you like to buy something else?");
- String com5 = input5.nextLine();
- switch(com5) {
- case "yes":
- System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
- break;
- case "no":
- System.out.println("Thank you, and have a nice day to You! :)");
- break;
- }
- break;
- case "cash":
- System.out.println("It will be: " + prices[2] + " PLN please");
- Scanner input6 = new Scanner(System.in);
- System.out.println("\n would you like to buy something else?");
- String com6 = input6.nextLine();
- switch(com6) {
- case "yes":
- System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
- break;
- case "no":
- System.out.println("Thank you, and have a nice day to You! :)");
- break;
- }
- break;
- default:
- System.out.println("just write: 'credit card' or 'cash' is this so hard?");
- break;
- }
- break;
- case "Skanska":
- System.out.println("\n\nKitchen table made in Taiwan");
- System.out.print("\nSize: " + sizes[2] + "x" + sizes[1] + "x" + sizes[3] + " centimeters" + "\n cost: " + prices[0] + " PLN");
- Scanner input3 = new Scanner(System.in);
- System.out.println("\nSo, would you like to pay by cash or credit card?");
- String com3 = input3.nextLine();
- switch (com3) {
- case "credit card":
- Scanner input7 = new Scanner (System.in);
- System.out.println("Wonderfull, it will be: " + prices[0] + "\nwould you like to buy something else?(yes / no): ");
- String com7 = input7.nextLine();
- switch(com7) {
- case "yes":
- System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
- break;
- case "no":
- System.out.println("Thank you, and have a nice day to You! :)");
- break;
- }
- case "cash":
- Scanner input8 = new Scanner(System.in);
- System.out.println("Wonderfull, it will be: " + prices[0] + "\nwould you like to buy something else?(yes / no): ");
- String com8 = input8.nextLine();
- switch(com8) {
- case "yes":
- System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
- break;
- case "no":
- System.out.println("Thank you, and have a nice day to You! :)");
- break;
- }
- case "Copenhagen" :
- 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");
- System.out.print("\nSize: " + sizes[2] + "x" + sizes[2] + "x" + sizes[2] + " centimeters" + "\n cost: " + prices[1] + " PLN");
- Scanner input4 = new Scanner(System.in);
- System.out.println("\nSo, would you like to pay by cash or credit card?");
- String com4 = input4.nextLine();
- switch (com4) {
- case "credit card":
- Scanner input9 = new Scanner(System.in);
- System.out.println("Wonderfull, it will be: " + prices[1] + "\nwould you like to buy something else?(yes / no): ");
- String com9 = input9.nextLine();
- switch(com9) {
- case "yes":
- System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
- break;
- case "no":
- System.out.println("Thank you, and have a nice day to You! :)");
- break;
- }
- break;
- case "cash":
- Scanner input10 = new Scanner(System.in);
- System.out.println("Wonderfull, it will be: " + prices[1] + "\nwould you like to buy something else?(yes / no): ");
- String com10 = input10.nextLine();
- switch(com10) {
- case "yes":
- System.out.println("Please, type a name of one of our products, which detailed data would you like: ");
- break;
- case "no":
- System.out.println("Thank you, and have a nice day to You! :)");
- break;
- }
- break;
- default:
- System.out.println("just write: 'credit card' or 'cash' is this so hard?");
- break;
- }
- break;
- default:
- System.out.println("Please, literally rewire letter by letter the name of a product: ");
- break;
- }
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement