Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This is the dumbest god damn program I've ever written. This is what happens when you
- * forget everything clever and practical and throw common sense out of the window.
- * I mean, it works, and it does everything you wanted it to do, but using "ArrayList<ArrayList<Integer>> sales = new ArrayList<ArrayList<Integer>>();"
- * 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
- * with it as I can't build it arround a smarter system.
- * Enjoy your laugh.
- * @author Jan Sarasvuo
- * @version W4Weekly
- */
- import java.util.*;
- public class SalesManager{
- public static void main(String[] args){
- List<Integer> week1 = new ArrayList<Integer>();
- List<Integer> week2 = new ArrayList<Integer>();
- int option;
- do {
- System.out.println("Please choose what you want to do by entering a number: \n");
- System.out.println("(1) Input last week's sales.");
- System.out.println("(2) Input this week's sales.");
- System.out.println("(3) Review weekly sales");
- System.out.println("(4) Remove last week's sales and replace with this week's sales.");
- System.out.println("(5) Exit.");
- Scanner input = new Scanner( System.in );
- option = input.nextInt();
- if(option == 1){
- System.out.println("Please enter your sales for Monday:");
- week1.add(input.nextInt());
- System.out.println("Please enter your sales for Tuesday:");
- week1.add(input.nextInt());
- System.out.println("Please enter your sales for Wednesday:");
- week1.add(input.nextInt());
- System.out.println("Please enter your sales for Thursday:");
- week1.add(input.nextInt());
- System.out.println("Please enter your sales for Friday:");
- week1.add(input.nextInt());}
- if(option == 2){
- System.out.println("Please enter this week's sales");
- System.out.println("Please enter your sales for Monday:");
- week2.add(input.nextInt());
- System.out.println("Please enter your sales for Tuesday:");
- week2.add(input.nextInt());
- System.out.println("Please enter your sales for Wednesday:");
- week2.add(input.nextInt());
- System.out.println("Please enter your sales for Thursday:");
- week2.add(input.nextInt());
- System.out.println("Please enter your sales for Friday:");
- week2.add(input.nextInt());
- }
- if(option == 3){
- System.out.println(week1);
- System.out.println(week2);
- }
- if (option == 4){
- week1.removeAll(week1);
- week1.clear();
- week1.addAll(week2);
- week2.clear();
- week2.addAll(week1);
- week2.removeAll(week2);
- }
- if (option == 5) {
- System.exit(0);
- }
- } while (option!=0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement