Welcome, I have a new challenge for you.
I ready?
OK, let's take a look.
In his challenge, you're going to create a program that will display the parts of a dynamically by
dynamically, I mean, it will get the current power automatically.
Let me show you how it's going to work.
OK, OK, so if it's the morning time, then your program should print good morning like this.
Or if it's afternoon, it should print good afternoon like this.
Or if it's evening time, then it should print good evening like this.
And lastly, if it's the night time, then it should print good night like this.
To solve this challenge, you need to use the time package.
Let me show you.
Here is the time package.
It allows you to work with the time values, it provides a lot of functionality, is working with time.
You've seen it before.
A lot is my favorite package inside the library.
Anyway, let's take a look at its online documentation.
This is the documentation of the now function of the time package by using this function.
I can learn about the current time, so when I call it, it would return a new time value.
Let's take a look.
Let me scroll down to the time type here, as you can see, it has a lot of methods declared on it since
I will display a message depending on the current hour.
So the one I'm looking for is this our method here?
All right, let's take a look.
It says that our returns the hour within the day specified by tea in the range zero three, this means
that it gets to time from the tea variable here and then it returns a number between zero and 23.
As you can guess, these numbers correspond to ours.
They.
Te variables value will be time that now, so it will contain the currency.
And since our method is declared on the time type, it can return the current hour.
So let me summarize what you've seen from the online documentation.
They call time that now function, it returns the current time as a value with a time type, it's like
returning a new instance of the time type and it initialized the new instance to the current time and
it returns back to as a value.
And as you've seen in the online documentation, the return time value contains a lot of methods for
working with time.
One of them is this Hober Method.
It lets us get the Arber from the time value.
Zero means midnight to 23 means 11 p.m. and so on.
Not that this our method will be called on an instance of a time type.
So it will get the current hour if the time value is created by calling time that now.
What it will return depends on the time value.
All right, to solve this challenge, you should use the other method from the time package.
OK, it returns to Karanth our.
And you should only use a switch statement, preferably you can use a short switch statement.
OK.
All right.
That's our challenge.
Good luck.
Bye for now.