I need a Java API which to call an URL and process what it return for part b in . the programs are what i did for the part a and c.
a. Enables the entry in a queue of a list of names of astronomical objects then to specify that the seizure is complete (by an empty string for example)
b. The program reviews the names entered and verifies that they are recognized names by the name resolver Sesam:
i. If yes we keep the name (or identifier) principal of the object. returns
ii. Otherwise we do not do anything and we move on to the next.
c. Finally, this program generates a text file (whose name can be entered) including all
This is my java program for the first and last part
Read a string from console using a BufferedReader.
import java.io.*;
class BRReadLines {
public static void main(String args[]) throws IOException {
// create a BufferedReader using System.in
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
String str;
System.out.println("Enter lines of text.");
System.out.println("Enter 'stop' to quit.");
do {
str = br.readLine();
System.out.println(str);
} while (!str.equals("stop"));
}
}
And this one for the third part
A tiny editor.
<code>
import java.io.*;
class TinyEdit {
public static void main(String args[]) throws IOException {
// create a BufferedReader using System.in
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
String str[] = new String[100];
System.out.println("Enter lines of text.");
System.out.println("Enter 'stop' to quit.");
for (int i = 0; i < 100; i++) {
str[i] = br.readLine();
if (str[i].equals("stop"))
break;
}
System.out.println("\\nHere is your file:");
// display the lines
for (int i = 0; i < 100; i++) {
if (str[i].equals("stop"))
break;
System.out.println(str[i]);
}
}
}
</code>
Thanks