Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.46 KB | None | 0 0
  1. /**
  2.  * This is the dumbest god damn program I've ever written. This is what happens when you
  3.  * forget everything clever and practical and throw common sense out of the window.
  4.  * I mean, it works, and it does everything you wanted it to do, but using "ArrayList<ArrayList<Integer>> sales = new ArrayList<ArrayList<Integer>>();"
  5.  * would had been so, so much smarter. I did invest too much time into a silly solution though, and now I'm kind of stuck
  6.  * with it as I can't build it arround a smarter system.
  7.  * Enjoy your laugh.
  8.  * @author Jan Sarasvuo
  9.  * @version W4Weekly
  10.  */
  11. import java.util.*;
  12. public class SalesManager{
  13.     public static void main(String[] args){
  14.         List<Integer> week1 = new ArrayList<Integer>();
  15.         List<Integer> week2 = new ArrayList<Integer>();
  16.         int option;
  17.        
  18.             do {
  19.                 System.out.println("Please choose what you want to do by entering a number: \n");
  20.                 System.out.println("(1) Input last week's sales.");
  21.                 System.out.println("(2) Input this week's sales.");
  22.                 System.out.println("(3) Review weekly sales");
  23.                 System.out.println("(4) Remove last week's sales and replace with this week's sales.");
  24.                 System.out.println("(5) Exit.");
  25.  
  26.                 Scanner input = new Scanner( System.in );
  27.                 option = input.nextInt();
  28.               if(option == 1){
  29.                      System.out.println("Please enter your sales for Monday:");
  30.                      week1.add(input.nextInt());
  31.                      System.out.println("Please enter your sales for Tuesday:");
  32.                      week1.add(input.nextInt());
  33.                      System.out.println("Please enter your sales for Wednesday:");
  34.                      week1.add(input.nextInt());
  35.                      System.out.println("Please enter your sales for Thursday:");
  36.                      week1.add(input.nextInt());
  37.                      System.out.println("Please enter your sales for Friday:");
  38.                      week1.add(input.nextInt());}
  39.               if(option == 2){
  40.                      System.out.println("Please enter this week's sales");
  41.                      System.out.println("Please enter your sales for Monday:");
  42.                      week2.add(input.nextInt());
  43.                      System.out.println("Please enter your sales for Tuesday:");
  44.                      week2.add(input.nextInt());
  45.                      System.out.println("Please enter your sales for Wednesday:");
  46.                      week2.add(input.nextInt());
  47.                      System.out.println("Please enter your sales for Thursday:");
  48.                      week2.add(input.nextInt());
  49.                      System.out.println("Please enter your sales for Friday:");
  50.                      week2.add(input.nextInt());
  51.                     }
  52.                      if(option == 3){
  53.                      System.out.println(week1);
  54.                      System.out.println(week2);
  55.                     }
  56.                      if (option == 4){
  57.                      week1.removeAll(week1);
  58.                      week1.clear();
  59.                      week1.addAll(week2);
  60.                      week2.clear();
  61.                      week2.addAll(week1);
  62.                      week2.removeAll(week2);
  63.                     }
  64.                     if (option == 5) {
  65.                         System.exit(0);
  66.                     }
  67.                 } while (option!=0);
  68.             }
  69.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement