Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class QuestionTwo{
- public static void main(String [] args){
- try{
- PrintWriter thirtyOrMore = new PrintWriter("largeCourses.txt");
- String s = " ";
- int n= 0;
- while(!Console.EndOfFile()){
- s = Console.readToken();
- n = Console.readInt();
- if(n>=30){
- thirtyOrMore.println(s + " ," + n);
- }
- }
- thirtyOrMore.close();
- }
- catch( Exception e)
- {
- System.out.println("Could not read file");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment