Hi again, everybody, I'm glad that you came to this lecture and today we will talk regarding methods
practice, I will go over the two parts, the two assignments, and afterwards, I want you to try to
get the answers by yourselves.
And don't worry, you will always have the following video, which you can find the answers.
OK, so these two parts will contain basically most of the topics that we have covered, the methods
you would have to use, tools that we've studied, the methods and also in past topics as well, such
as if statements for loops and so on.
And.
All right.
I just want you to know that it's going to be a bit more challenging.
But I think that you can you can perfectly get it together and resolve it by yourselves.
You have all the tools that you needed in the previous lectures, and I think it's not a problem.
OK, so let's go over the two assignments.
All right.
So in part a first of all, first first of all, create a new method and you can call it sorting.
It will receive arbitrary arguments, meaning each time it will receive a different amount of arguments
and you should execute it three times with the following variables passed into the method.
OK, so in the first execution, please pass Python in Java.
Second one is Python Java and go go with the Google programming language and in the third execution
pass, Python, JavaScript and C++.
OK, so once these variables are passed from the execution into the method inside the method, please
do the following.
All right.
Please use a loop.
OK, and fine.
If Java is one of the values, OK, I want you to create a loop and each cycle of the loop will check
one of these values and it will test whether it's Java or not.
I'm not going to give you any more hints than that because I want you to think by yourselves on which
topics and which techniques you should use here and get the resolution by yourselves.
So it will be a bit more challenging.
As in previous lectures, we you have got some guidance on what tools to use, but this time I just
think by yourselves and use the tools that you've acquired from previous lectures.
OK, so all right.
So as I just mentioned, just fine with a java is one of the values each time Skåne one of these values.
And once you find Java, please do the following thing.
Please print that variable, the variable Java letters, one above the other inside the output terminal,
meaning use to be printed in a way that the letters will go one under the other as following inside
the output terminal.
OK, so this basically covers the Part eight assignments regarding methods.
There's nothing that you can't handle here.
You're using the tools from previous videos.
OK, so let's from here go to Poppy.
Let's cover these topics as well.
These are assignments as well.
So in part B, OK, I create the method.
You can call it tax calculation.
We've already done some task calculation assignments in previous topics.
And let's do it one more time.
We'll get two variables.
The method would get two variables, which will be gross salary and tax.
And notice that if not tax variable is passed into the method, it should use zero that to two by default.
All right.
And right here you have the three three execution's three like groups of variables which will be passed
to the method in three separate execution's.
So you have five thousand is the salary and zero that to which is the tax.
You have C six thousand and zero twenty two.
And notice the last one is only the salary then grant ten grand.
But the salary is not mentioned here.
OK, so you need to overcome this so there is no error occurs once you execute the last one.
All right.
So in this first method, after we pass these variables into it, please calculate the net salary.
OK, this is a variable inside it just need to initiate a new variable inside the method and calculate
the net salary salary by reducing the tax out of the gross salary, which the gross salary is the the
variable that was passed into the method.
So apply tax reduction.
You need to create a certain calculation.
So just think the.
Salary and remove the taxes from it.
OK, and then once you reduce the gross salary, just return it at the end of the method, just return
the gross salary.
Once the method gets to the final stages, just return it outside of the method and also afterwards
create the second method and call it salary limit testor.
It should get the net salary variable.
All right.
And check whether it's above five thousand eight hundred.
OK.
All right.
OK, so it should check whether the net salary is above above five hundred, either salary is above
five thousand eight hundred stated state stated in a print and mentioned the value of the test and salary
basically in both cases.
Whether the salary is above or below.
Stated.
All right, so I think this covers let me just make it a bit smaller because it gets to the second page.
All right, so basically you have two different assignments here.
First one would use arbitrary arguments and the second one would use other subtopics that we have covered,
such as using a default variable and such as passing variables from one method to another.
OK, I will see in the next lecture where you can see the answers for these assignments.
Good luck.