-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathMain.java
More file actions
58 lines (54 loc) · 2.55 KB
/
Main.java
File metadata and controls
58 lines (54 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
// TODO --> complete main function.
runMenu();
}
public static void runMenu() throws IOException {
// TODO
Scanner scanner = new Scanner(System.in);
System.out.println("Hello");
System.out.println("Which one do you want?");
System.out.println("1-Mvie");
System.out.println("2-Actor/Actress");
int n = scanner.nextInt();
if (n == 1) {
System.out.println("Enter the name of the movie");
String name = scanner.next();
Movie movie = new Movie(new ArrayList<>(), "", 0, "", "", "", "", "");
String found = movie.getResponsive(movie.getMovieData(name));
while (true) {
if (found == "false") {
System.out.println("Movie not found, pleas try again!");
name = scanner.next();
found = movie.getResponsive(movie.getMovieData(name));
}
if (found == "true") {
System.out.println(movie.getImdbVotesViaApi((movie.getMovieData(name))));
System.out.println(movie.getRatingViaApi((movie.getMovieData(name))));
System.out.println(movie.getDirector(movie.getMovieData(name)));
System.out.println(movie.getWriter(movie.getMovieData(name)));
System.out.println(movie.getActorListViaApi(movie.getMovieData(name)));
System.out.println(movie.getGener(movie.getMovieData(name)));
System.out.println(movie.getLanguage(movie.getMovieData(name)));
break;
}
}
}
if (n == 2) {
System.out.println("Enter the name of the actor/actress");
String name = scanner.next();
Actors actors = new Actors("", false, "", "", "");
System.out.println(actors.getNetWorthViaApi(actors.getActorData(name)));
System.out.println(actors.isAlive(actors.getActorData(name)));
System.out.println(actors.getGender(actors.getActorData(name)));
System.out.println(actors.getNationality(actors.getActorData(name)));
System.out.println(actors.getDateOfDeathViaApi(actors.getActorData(name)));
System.out.println(actors.getBirthday(actors.getActorData(name)));
}
}
}