You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,13 +12,16 @@ Create class Solution with the main method.
13
12
Implement two static methods - findAvgBudgetByDirector and getMovieByRatingBudget in Solution class.
14
13
15
14
findAvgBudgetByDirector method:
15
+
----------------------------------
16
16
This method will take two input parameters - array of Movie objects and string parameter director.
17
17
The method will return the average of the budget attribute from Movie objects directed by the director passed as parameter.
18
18
If no movie with the given director is present in the array of movie objects, then the method should return 0.
19
19
20
20
getMovieByRatingBudget method:
21
+
----------------------------------
21
22
This method will take two int parameters rating and budget, along with the array of movie objects.
22
-
The method will return the movie object, if the input parameters rating and budget, matches with the rating and budget attribute of the movie object respectively.
23
+
The method will return the movie object, if the input parameters rating and budget, matches with the rating and budget
24
+
attribute of the movie object respectively.
23
25
24
26
Also check if rating is a factor of budget (eg: 3 is a factor of 12 because 3 divides 12 without leaving a remainder).
25
27
If any of the conditions are not met, then the method should return null.
@@ -30,39 +32,38 @@ The budget mentioned are in crores and in INR.
30
32
31
33
These above mentioned static methods should be called from the main method.
32
34
33
-
For findAvgBudgetByDirector method - The main method should print the average budget as it is if the returned value is greater than 0, or it
34
-
should print "Sorry - The given director has not yet directed any movie".
35
-
36
-
For getMovieByRatingBudget method - The main method should print the movieId of the returned movie object. If the returned value is null
37
-
then it should print "Sorry - No movie is available with the specified rating and budget requirement".
38
-
39
-
Before calling these static methods in main, use Scanner object to read the values of four
40
-
Movie objects referring attributes in the above mentioned attribute sequence.
41
-
Next, read the value for director, rating and budget.
42
-
43
-
## Input
44
-
45
-
1101
46
-
GVM
47
-
4
48
-
100
49
-
1201
50
-
Shankar
51
-
5
52
-
500
53
-
1301
54
-
Shankar
55
-
3
56
-
50
57
-
1401
58
-
GVM
59
-
5
60
-
300
61
-
GVM
62
-
5
63
-
300
64
-
65
-
## Output
66
-
67
-
200
68
-
1401
35
+
For findAvgBudgetByDirector method - The main method should print the average budget as it is if the returned value is
36
+
greater than 0, or it should print "Sorry - The given director has not yet directed any movie".
37
+
38
+
For getMovieByRatingBudget method - The main method should print the movieId of the returned movie object. If the returned
39
+
value is null then it should print "Sorry - No movie is available with the specified rating and budget requirement".
40
+
41
+
Before calling these static methods in main, use Scanner object to read the values of four Movie objects referring attributes
42
+
in the above mentioned attribute sequence. Next, read the value for director, rating and budget.
0 commit comments