Advertisement
oona

organizing tasks 2

Jan 24th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. import java.util.*;
  2.  
  3.  
  4. public class organizingTasks2 {
  5.  
  6.     public static void main(String[] args) {
  7.         // TODO Auto-generated method stub
  8.        
  9.         //inputs
  10.         ArrayList <String> assignmentsToDo = new ArrayList <String> ();
  11.         ArrayList <Integer> priorities = new ArrayList <Integer> ();
  12.        
  13.         char keepGoing = 'Y';
  14.         String assignment;
  15.         int priority;
  16.        
  17.         while(keepGoing != 'N' || keepGoing != 'n')
  18.         {
  19.             System.out.println("What's your assignment?");
  20.             assignment = TextIO.getWord(); //accept choice as String
  21.            
  22.             assignmentsToDo.add(assignment);
  23.            
  24.             System.out.println("How important is the assignment (1 - least, 2 - more or less, 3 - one of the most important?");
  25.             System.out.println("[a) 1 | b) 2 | c) 3]");
  26.             priority = TextIO.getInt(); //accept choice as an integer
  27.            
  28.             priorities.add(priority);
  29.            
  30.             System.out.println("Do you have any other assignments?");
  31.             keepGoing = TextIO.getChar(); //accept choice as character
  32.         }
  33.        
  34.         System.out.println("Assignment" + assignmentsToDo);
  35.         System.out.println("and their priorities are " + priorities);
  36.  
  37.     } //class ends
  38.  
  39. } //program ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement