Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class organizingTasks2 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- //inputs
- ArrayList <String> assignmentsToDo = new ArrayList <String> ();
- ArrayList <Integer> priorities = new ArrayList <Integer> ();
- char keepGoing = 'Y';
- String assignment;
- int priority;
- while(keepGoing != 'N' || keepGoing != 'n')
- {
- System.out.println("What's your assignment?");
- assignment = TextIO.getWord(); //accept choice as String
- assignmentsToDo.add(assignment);
- System.out.println("How important is the assignment (1 - least, 2 - more or less, 3 - one of the most important?");
- System.out.println("[a) 1 | b) 2 | c) 3]");
- priority = TextIO.getInt(); //accept choice as an integer
- priorities.add(priority);
- System.out.println("Do you have any other assignments?");
- keepGoing = TextIO.getChar(); //accept choice as character
- }
- System.out.println("Assignment" + assignmentsToDo);
- System.out.println("and their priorities are " + priorities);
- } //class ends
- } //program ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement