You almost finished this section before that.
I have one more task for you and section task, as usually I will tell you what the task is, then you
should try to solve it on your own.
And if you are finished, get back to this video and watch how I solved it.
I would like to point out that if you use a different text format or solution, don't worry, that's
not a problem.
I write the code based on my ideas.
If you do it based on your own ideas and it works properly, that's fine to the following task is going
to combine all the features you learned in this section.
OK, here we go.
And this task, I would like you to create an IMDB application.
Your first step would be to go to IMDB dot com and choose an actress or actor.
I will go with Tom Cruise.
I like him as an actor.
Next, you will need the person's date of birth and some movie titles and ratings, then create variables
for name, year of an array for movie titles and another one for ratings.
First, print out the name of the person.
Second printout the year of Born and calculate the age.
Don't bother with the months just subtracted from the current year, then print out the movie titles.
After that, create a function that takes the ratings and returns the following strings, if the rating
is less than five point zero, return bad average, if it's between five and six point five, good between
six point five and seven point zero.
Very good.
Between seven point zero and eight point zero.
And amazing.
If the rating is about eight, the final step would be to add the return value to the title and print
out both in the same line for every movie.
All right, let's get back to A.J..
OK, let's create a new class for this.
So, right, click new Java class, I am DBE up onto Capac main method.
Posted here and to first define the actor's name string.
Actor name equals double quotes, Tom.
Crews found a semicolon, the next one is going to be of bore and it's going to be an end and you're
both born equals 1962 semicolon.
Now calculate the age.
So and age equals twenty, twenty minus a year of born and a semicolon.
Now initialize the movie titles, array, string square brackets, movie titles equals curly braces
and a semicolon hit enter.
OK, I think the best Tom Cruise movies, The Last Samurai.
So let's go with that.
The Last Samurai olma.
The next one is Minority Report.
Minority
Report olma Taupo quotes Tolkan Colma New Line, Rainman, Colma, Cocktail Colma Me
and Last American Made.
All right, let's create the rating, right?
So it's going to store floats, sort of float square brackets, movie
ratings.
Equals curly braces and a semicolon hit enter here as long these volumes are going to be float's, we
have to put an F to the end of the numbers.
Start with last summer rating seven point seven and an F then comma.
Seven point six 1/2 for Minority Report then.
Six point nine for Top Gun, eight point zero for Rain Man and and five point nine to cocktail, five
point four for the mommy and seven point one for the American made.
OK, let's print out the actor's name first.
So system that our dot print Allen double quotes, actor's name calling and the space plus actors name
variable.
The next is Year of More and the age so system that outdoor spring to learn double quotes for.
Column space plus year of boring variable loss, double quotes, space parentheses plus age.
Plus, double quotes.
Space years old and White Prentice's now the movie titled Solar System that outdraw print on double
codes, movies
on.
Now, a follow up, I'm going to use the shortcuts before I enter in the condition type and movie titles,
DOT lands.
System doled out that Winterland movie titles, square brackets.
All right, now create a get rating function.
Start with static.
Strained to return to the function name get rating Prentice's the perimeter is going to be a flawed
rating.
Curly braces then if statement.
So if the rating is less than or equal to 5.0, curly braces return double quotes bad.
Something else, if Prentice's rating is greater than 5.0 and and rating as lasdun or equals six point
five curly braces, return, return average SEMICON copied and pasted here and here again.
So change the condition here to six point five and here seven point zero seven point zero and here eight
point zero.
Change the text average to good here.
And very good here and last, we're going to need an else.
If the rating is higher than eight point zero.
Curly braces and return amazing.
And it's SEMICON now at the functions resort to every movie titles, so plus double code space dash
space plus.
The function name got rating, the parameter is going to be movie ratings.
Square brackets and the index is going to be I now run our code and see the result.
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,
so that's it.
I suggest you to do your own version after this.
Use array's functions, lubes, control floors.
If you don't have any idea what to do, you will find some other type of tasks after this lecture.
Suing the N.S.A. summary.