ADoyle4

Untitled

Apr 3rd, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import java.io.*;
  2. public class QuestionTwo{
  3. public static void main(String [] args){
  4. try{
  5. PrintWriter thirtyOrMore = new PrintWriter("largeCourses.txt");
  6. String s = " ";
  7. int n= 0;
  8. while(!Console.EndOfFile()){
  9. s = Console.readToken();
  10. n = Console.readInt();
  11. if(n>=30){
  12. thirtyOrMore.println(s + " ," + n);
  13. }
  14. }
  15. thirtyOrMore.close();
  16. }
  17. catch( Exception e)
  18. {
  19. System.out.println("Could not read file");
  20. }
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment