1 00:00:01,540 --> 00:00:04,220 You almost finished this section before that. 2 00:00:04,390 --> 00:00:12,190 I have one more task for you and section task, as usually I will tell you what the task is, then you 3 00:00:12,190 --> 00:00:13,980 should try to solve it on your own. 4 00:00:14,440 --> 00:00:19,390 And if you are finished, get back to this video and watch how I solved it. 5 00:00:20,020 --> 00:00:26,320 I would like to point out that if you use a different text format or solution, don't worry, that's 6 00:00:26,320 --> 00:00:27,100 not a problem. 7 00:00:27,320 --> 00:00:29,520 I write the code based on my ideas. 8 00:00:29,860 --> 00:00:37,270 If you do it based on your own ideas and it works properly, that's fine to the following task is going 9 00:00:37,270 --> 00:00:40,540 to combine all the features you learned in this section. 10 00:00:40,900 --> 00:00:41,940 OK, here we go. 11 00:00:42,760 --> 00:00:46,360 And this task, I would like you to create an IMDB application. 12 00:00:46,690 --> 00:00:53,160 Your first step would be to go to IMDB dot com and choose an actress or actor. 13 00:00:53,830 --> 00:00:55,770 I will go with Tom Cruise. 14 00:00:55,780 --> 00:00:57,330 I like him as an actor. 15 00:00:57,850 --> 00:01:05,950 Next, you will need the person's date of birth and some movie titles and ratings, then create variables 16 00:01:05,950 --> 00:01:12,490 for name, year of an array for movie titles and another one for ratings. 17 00:01:13,240 --> 00:01:15,280 First, print out the name of the person. 18 00:01:15,640 --> 00:01:19,660 Second printout the year of Born and calculate the age. 19 00:01:20,200 --> 00:01:26,980 Don't bother with the months just subtracted from the current year, then print out the movie titles. 20 00:01:27,870 --> 00:01:35,130 After that, create a function that takes the ratings and returns the following strings, if the rating 21 00:01:35,130 --> 00:01:43,830 is less than five point zero, return bad average, if it's between five and six point five, good between 22 00:01:43,830 --> 00:01:46,150 six point five and seven point zero. 23 00:01:46,770 --> 00:01:47,680 Very good. 24 00:01:47,700 --> 00:01:51,060 Between seven point zero and eight point zero. 25 00:01:51,390 --> 00:01:52,740 And amazing. 26 00:01:52,740 --> 00:02:00,180 If the rating is about eight, the final step would be to add the return value to the title and print 27 00:02:00,180 --> 00:02:03,420 out both in the same line for every movie. 28 00:02:04,050 --> 00:02:05,930 All right, let's get back to A.J.. 29 00:02:08,380 --> 00:02:10,730 OK, let's create a new class for this. 30 00:02:10,780 --> 00:02:20,530 So, right, click new Java class, I am DBE up onto Capac main method. 31 00:02:24,310 --> 00:02:30,220 Posted here and to first define the actor's name string. 32 00:02:32,440 --> 00:02:38,470 Actor name equals double quotes, Tom. 33 00:02:40,300 --> 00:02:49,960 Crews found a semicolon, the next one is going to be of bore and it's going to be an end and you're 34 00:02:50,320 --> 00:02:57,650 both born equals 1962 semicolon. 35 00:02:58,600 --> 00:03:00,250 Now calculate the age. 36 00:03:00,880 --> 00:03:12,200 So and age equals twenty, twenty minus a year of born and a semicolon. 37 00:03:12,490 --> 00:03:26,560 Now initialize the movie titles, array, string square brackets, movie titles equals curly braces 38 00:03:26,590 --> 00:03:29,620 and a semicolon hit enter. 39 00:03:29,890 --> 00:03:33,820 OK, I think the best Tom Cruise movies, The Last Samurai. 40 00:03:33,830 --> 00:03:35,380 So let's go with that. 41 00:03:36,320 --> 00:03:41,460 The Last Samurai olma. 42 00:03:41,800 --> 00:03:44,800 The next one is Minority Report. 43 00:03:44,800 --> 00:03:45,760 Minority 44 00:03:47,890 --> 00:04:06,790 Report olma Taupo quotes Tolkan Colma New Line, Rainman, Colma, Cocktail Colma Me 45 00:04:10,450 --> 00:04:13,330 and Last American Made. 46 00:04:20,870 --> 00:04:24,330 All right, let's create the rating, right? 47 00:04:24,830 --> 00:04:32,990 So it's going to store floats, sort of float square brackets, movie 48 00:04:35,540 --> 00:04:36,500 ratings. 49 00:04:37,810 --> 00:04:46,720 Equals curly braces and a semicolon hit enter here as long these volumes are going to be float's, we 50 00:04:46,720 --> 00:04:49,210 have to put an F to the end of the numbers. 51 00:04:50,110 --> 00:04:57,190 Start with last summer rating seven point seven and an F then comma. 52 00:04:58,940 --> 00:05:06,530 Seven point six 1/2 for Minority Report then. 53 00:05:07,950 --> 00:05:24,120 Six point nine for Top Gun, eight point zero for Rain Man and and five point nine to cocktail, five 54 00:05:24,120 --> 00:05:31,590 point four for the mommy and seven point one for the American made. 55 00:05:32,380 --> 00:05:35,040 OK, let's print out the actor's name first. 56 00:05:35,820 --> 00:05:48,780 So system that our dot print Allen double quotes, actor's name calling and the space plus actors name 57 00:05:48,790 --> 00:05:49,620 variable. 58 00:05:50,010 --> 00:05:59,610 The next is Year of More and the age so system that outdoor spring to learn double quotes for. 59 00:06:01,360 --> 00:06:14,440 Column space plus year of boring variable loss, double quotes, space parentheses plus age. 60 00:06:17,260 --> 00:06:20,130 Plus, double quotes. 61 00:06:22,120 --> 00:06:32,800 Space years old and White Prentice's now the movie titled Solar System that outdraw print on double 62 00:06:32,800 --> 00:06:34,750 codes, movies 63 00:06:38,090 --> 00:06:38,320 on. 64 00:06:41,450 --> 00:06:53,780 Now, a follow up, I'm going to use the shortcuts before I enter in the condition type and movie titles, 65 00:06:54,740 --> 00:06:56,030 DOT lands. 66 00:06:59,140 --> 00:07:05,790 System doled out that Winterland movie titles, square brackets. 67 00:07:08,230 --> 00:07:11,620 All right, now create a get rating function. 68 00:07:13,450 --> 00:07:14,920 Start with static. 69 00:07:17,560 --> 00:07:28,150 Strained to return to the function name get rating Prentice's the perimeter is going to be a flawed 70 00:07:29,320 --> 00:07:30,070 rating. 71 00:07:30,700 --> 00:07:34,540 Curly braces then if statement. 72 00:07:35,970 --> 00:07:50,310 So if the rating is less than or equal to 5.0, curly braces return double quotes bad. 73 00:07:52,260 --> 00:08:12,840 Something else, if Prentice's rating is greater than 5.0 and and rating as lasdun or equals six point 74 00:08:12,840 --> 00:08:27,990 five curly braces, return, return average SEMICON copied and pasted here and here again. 75 00:08:28,860 --> 00:08:42,900 So change the condition here to six point five and here seven point zero seven point zero and here eight 76 00:08:42,900 --> 00:08:44,250 point zero. 77 00:08:45,810 --> 00:08:50,640 Change the text average to good here. 78 00:08:51,830 --> 00:08:59,570 And very good here and last, we're going to need an else. 79 00:09:01,260 --> 00:09:04,170 If the rating is higher than eight point zero. 80 00:09:05,660 --> 00:09:11,180 Curly braces and return amazing. 81 00:09:13,970 --> 00:09:24,770 And it's SEMICON now at the functions resort to every movie titles, so plus double code space dash 82 00:09:24,770 --> 00:09:26,870 space plus. 83 00:09:28,060 --> 00:09:35,500 The function name got rating, the parameter is going to be movie ratings. 84 00:09:36,570 --> 00:09:43,740 Square brackets and the index is going to be I now run our code and see the result. 85 00:09:48,660 --> 00:09:56,130 So Tom Cruise is 58 years old and you can see a list of movies he was in and the text based on the ratings, 86 00:09:56,940 --> 00:09:57,950 so that's it. 87 00:09:58,110 --> 00:10:00,810 I suggest you to do your own version after this. 88 00:10:00,900 --> 00:10:04,110 Use array's functions, lubes, control floors. 89 00:10:04,590 --> 00:10:10,610 If you don't have any idea what to do, you will find some other type of tasks after this lecture. 90 00:10:11,820 --> 00:10:13,560 Suing the N.S.A. summary.