Welcome, I prepared the mini challenge for you.
Let's take a look.
Your task is to display random words.
Let me show you.
When you run the program, it should ask you for a name.
Let's give it a name.
As you can see, each time I ran the program, it displays a random mood you need to store these moods
in an area that you should randomly fetch and print one of them.
OK, it's that simple.
As always, you can find this exercise and its solution in the course of depositary.
OK, now please pass the video here and try to solve this challenge.
I'll give you the solution also in this lecture, by the way.
All right, let's take a look at the solution.
First, I'm going to get the command line arguments like this.
And then I'm going to check whether the user has provided a name or not, if not, I'm going to print
a usage message like this.
And then I'm going to exit from the program.
OK, let me start the user name in this variable.
All right, now I'm going to start the mood in a string using the ellipses like this.
So using an ellipsis here is perfect for this use case, so I don't need to count the number of mood
swings myself, go does that for me.
Then I'm going to add a few more mouths like this.
Let's also add some negative moods.
I need to display random moods, right, so I need to see the random number generator first.
Then I'm going to fetch a random number between zero and the length of the mood's like this.
This will give me a random index number so I can print a random mood from the mouse.
Right now I'm going to print them out first with the name of the user and then with a random.
Cool.
Let's run it now.
Let's run it without a name first, good, it works.
Now let's run it with a name like this.
Cool.
I like it.
All right, that's all for this mini exercise.
See in the next picture.