Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package app.com;
- import java.util.ArrayList;
- import java.util.Scanner;
- public class AstroApp
- {
- public static void main(String args[])
- {
- Scanner KeyboardInput = new Scanner( System.in );
- String NGCObject;
- System.out.println("Enter the NGC ID or the Name of the object you would like to view. ");
- NGCObject = KeyboardInput.next();
- ArrayList<AstroObject> Target = new ArrayList<AstroObject>();
- Target.add(new AstroObject("Crab_Nebula", 5.5756 ,22.0144 , 6, "1952", 8.4));
- for(AstroObject item : Target)
- {
- if(NGCObject.equals(item.getNGCID()))
- {
- System.out.println(
- item.getName() +
- "." +
- "Its Ra And Dec are " +
- item.getRA() +
- " " +
- item.getDec() +
- " Its Size is " +
- item.getSize() +
- "'" + "
- Its Apparent Magnitude is " +
- item.getBrightness() +
- " Its NGC Number is: " +
- item.getNGCID()
- );
- }
- if(NGCObject.equals(item.getName()))
- {
- System.out.println(
- item.getName() +
- "." +
- "Its Ra And Dec are " +
- item.getRA() +
- " " +
- item.getDec() +
- " Its Size is " +
- item.getSize() +
- "'" +
- " Its Apparent Magnitude is " +
- item.getBrightness() +
- " Its NGC Number is: " +
- item.getNGCID()
- );
- }
- else
- {
- System.out.println("ERROR");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement