Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package s3task2;
- import java.lang.reflect.Array;
- import java.util.ArrayList;
- import java.util.Scanner;
- /**
- *
- * @author Laney47
- */
- public class S3Task2 {
- Scanner sc = new Scanner(System.in);
- private int input;
- static S3Task2 out = new S3Task2();
- private ArrayList<String> issuelist = new ArrayList<String>();
- private ArrayList<String> solved = new ArrayList<String>();
- private ArrayList<String> unsolved = new ArrayList<String>();
- Issue call = new Issue();
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- while(out.input <5){
- out.Menu();
- }
- }
- private void Menu(){
- System.out.println("Ange alternativ: " +"\n"+"1 Lägg till "+ "\n" +"2 Markera som olöst/lösta" + "\n" + "3 Visa lösta"+ "\n"+ "4 Visa olösta"+ "\n"+"5 Exit");
- input = sc.nextInt();
- if(input ==1){
- out.newIssue();
- }
- else if(input ==2){
- out.declareIssue();
- }
- else if(input ==3){
- out.solvedIssue();
- }
- else if(input ==4){
- out.unsolvedIssue();
- }
- else{
- }
- }
- private void newIssue(){
- System.out.println(sc.nextLine());
- System.out.println("Ange problem");
- call.setIssue(sc.nextLine());
- issuelist.add(call.getIssue());
- }
- private void declareIssue(){
- System.out.println("Markera dom som är lösta");
- for(int i = 0; i <out.issuelist.size(); i++){
- System.out.println((i)+" " +out.issuelist.get(i));
- }
- }
- private void solvedIssue(){
- for(int i = 0; i < out.solved.size(); i++){
- System.out.println((i)+" " +out.solved.get(i));
- }
- }
- private void unsolvedIssue(){
- for(int i = 0; i < out.unsolved.size(); i++){
- System.out.println((i)+" "+ out.unsolved.get(i));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement