Hi, everybody, and welcome.
So in this lecture, we will try to answer your homework regarding integer and fourth variables, so
please open your project that we started at the beginning of the course.
And then after it's open, you probably pretty much remember just click file and open and then choose
your destination, you meaning your project right here.
And once you see the square here, just double click on it.
All right.
Before we begin.
Guys, I just want to remind you guys that each lecture has attachment files with everything that we
are studying here.
So you can have it as files on your computer.
So you could practice it later as well.
All right.
So once we are up, let's just click on the project file and you can create a new file called Integer
and Float.
Practice.
All right.
By the way, guys, this is a good practice to always leave notes for times that you going to get back
to these files from time, from some time from now, and you would know what's going on and these notes
really helpful.
All right.
So let's begin, guys.
First of all, let's try to set all the values.
So, first of all, is gross.
Paycheck.
Which is ten thousand dollars that we have health.
Insurance, which is five hundred thirty eight ninety nine, and then we have rent, twelve hundred
and food, we get a discount of half a dollar and then we have tax.
All right, guys, about tax here writes it zero point two, but John, don't remember that this is
in.
Percent's right, this is not a numeric value for money.
It stands four percent and last headline donation for the poor.
And this one is zero point one, and it's also in percent.
All right, so first of all, let us.
Calculate net salary, so the basic math that we need to do here is to, first of all, create a new
variable net salary and that would equals here and will back it will be back in it in a minute, but
before it.
And first, let us create a tax.
Amount in money and do equals here and at stake, the gross salary, the gross paycheck and multiplied
on donation, no, not donations, saurian tax and this would be the tax deduction that we need to do
from our gross paycheck in here.
So this is like a pre calculation for the main mission of our task.
So we have a gross paycheck and let's deduct tax amount in money.
It's right here in the pop up unter and health insurance.
And rent them food.
All right, so let's print it, and this would be our net salary and let's do a plus here.
And as you recall from previous lectures, as we have a print here so we can have only one type here
instead of print.
So here we have a string.
All right.
But now we want to insert a number in here.
But it will give us an error, of course, because we have a integer and here we have a string.
So what we need to do is to convert it to string, uh, with a special keyword and brackets around it.
And let's try to print it.
All right.
So there you have it, this is Yonath salary, reduced all of the expenses, including tax in percents
that we did right here.
All right.
So let's go further to calculating the donation to poor.
Taken from.
That salary.
So as you can guess, we already did some kind of math action here that is really similar, of course,
regarding the donation amount, and I would like you to try to guess what is the similar math calculation
that we did in this call that is really similar to calculating the donation to the poor out of the net
salary?
All right, so this is the answer, guys, because it's the same thing here.
This is in percentage and this is also in percentages.
So the calculation would be similar, right.
So we just need to make a new variable called donation amount equals and then take our net salary and
multiply it with a donation to the poor.
And that sprint it sprint and then donation.
Amount in money.
Will be plus.
Donation amount and also we need to make it a string, as we did before.
All right, so it's printed.
So there you have it.
So this is the donation amount.
It's not the amount.
It's amount.
So this is the donation amount and calculated out of the net salary.
And that's about it, guys.
So we had a mixture here of all concepts regarding numbers.
And we have integer numbers here.
We have a float numbers.
We have pissants here and we have calculated the mix of them.
So we have here float a float result and also you float result here because we can see it's numbers
Bastad decimal and you can sleep calmly tonight because I assure you that now you know your stuff among
integer and float variables.
And that's amazing, guys.
So it's great progress because it's a really important part of the course to know how to manipulate
numbers.
And I'm very happy that we are done with this part.
And let's go over to the next topic.