Now it is time again for exercise, so I want you to do the following exercise.
Imagine that you are a company.
You want to hire programmers just like you.
So there are few requirements for the programmers.
So first of all, they need to have a master degree.
So master degree.
We require.
OK.
And also they need to have more than two years of experience.
So I wanted to create an if statement that is chicken for both conditions, that you have a master degree
or above.
So you should also be fine, right?
And also, you need to check if you have two years of experience.
OK, so in case one of these things is not met, then you should say that the candidate is not suitable
for the job.
OK, so I will give you about five minutes to do this one, because I believe that you need to think
of it, try to do it for five minutes.
And if you cannot do it, please go back to that video and see my solution.
OK, so the solution or code is simple.
Actually, if you didn't do it exactly like I did, this is not a problem.
As long as it works fine, because you can write your code in many different ways in all the.
Correct.
Right.
So let's start, first of all, write one variable called degree equals input.
And hearing this input, I will simply ask the user what is his degree.
So what is your.
Degree, obviously, in parentheses, and then let's write.
M..
Bachelor or Ajda, OK, then.
Let's ask our user to write his experience.
Experience equals input.
How many years of experience is do you have since we have this variable?
Now it's time to create the statement.
So let's write it.
Degree is sequel to.
Master or.
Degree is equal to muster with small letters, with lowercase letters, so we ensure that we take both
cases or we agree is equal to VTE or vagary is supposed to be HD.
Then this means that our.
Candidate has the right degree, right, if he has one of these.
So since our candidate has the right degree, we would also like to check if he has the right experience.
So for that reason, I would create one more if look here, which actually the combination of the two
flubs is, quote, the nested loops.
So that's a check for one of the conditions.
Then you move on and check for the other one.
So, all right.
If int.
Experience in here, I write in because I want the experience to be as an integer variable.
OK.
So if the experience is higher or equal to two years, then our candidate, he has the right experience
and for that reason we can print to the candidate you are.
Accepted for the interview.
Now we have the best case scenario and we did properly, but now we need to see what's going to happen
if the candidates don't have one of these conditions.
Right.
So let's right here else and here this else is for the second if looked right, because he's in the
inner in the station level so else, which means that our candidate don't have experience higher or
equal to three years.
So else print you don't.
Have.
In the.
Experience, right, and then if the candidates don't have the degree.
So if you don't have the degree, then we'd like to write a statement else.
Friends, you don't.
Half the report IUT degree, and here I will just make the cosine double, because this is the way that
we compare to objects.
OK, so while this is them, let's run the coat and see what is going to happen here.
So as you can see, the program is asking if you have a degree in what it is right here, master, then
it will ask us how many years of experience do we have?
I will write one here and you can see that we are prompted that we have only one year so we don't have
enough experience for this job.
Let's run the program once again.
OK, let's see if what's going to happen if we don't have the right degree.
So let's see if we have only a better degree.
Let's say we have five years of experience and we can see that we don't have the required degree.
And finally, let's make one case.
That's correct.
So we can test every object of our law, of our if statement.
So I will right the degree be aged in the years of experience then.
You can see that our program is saying that we are accepted for the interview, which means that everything
works fine.