1 00:00:12,030 --> 00:00:13,650 Hi, everybody, and welcome. 2 00:00:13,860 --> 00:00:22,350 So in this lecture, we will try to answer your homework regarding integer and fourth variables, so 3 00:00:22,650 --> 00:00:26,280 please open your project that we started at the beginning of the course. 4 00:00:26,670 --> 00:00:34,530 And then after it's open, you probably pretty much remember just click file and open and then choose 5 00:00:34,530 --> 00:00:38,580 your destination, you meaning your project right here. 6 00:00:38,580 --> 00:00:41,910 And once you see the square here, just double click on it. 7 00:00:43,170 --> 00:00:43,710 All right. 8 00:00:44,100 --> 00:00:44,970 Before we begin. 9 00:00:45,000 --> 00:00:50,520 Guys, I just want to remind you guys that each lecture has attachment files with everything that we 10 00:00:50,520 --> 00:00:51,420 are studying here. 11 00:00:51,660 --> 00:00:54,270 So you can have it as files on your computer. 12 00:00:54,270 --> 00:00:55,990 So you could practice it later as well. 13 00:00:56,580 --> 00:00:56,860 All right. 14 00:00:56,860 --> 00:01:06,270 So once we are up, let's just click on the project file and you can create a new file called Integer 15 00:01:07,020 --> 00:01:08,220 and Float. 16 00:01:11,930 --> 00:01:12,670 Practice. 17 00:01:13,970 --> 00:01:14,600 All right. 18 00:01:20,460 --> 00:01:28,860 By the way, guys, this is a good practice to always leave notes for times that you going to get back 19 00:01:28,860 --> 00:01:35,940 to these files from time, from some time from now, and you would know what's going on and these notes 20 00:01:35,940 --> 00:01:36,680 really helpful. 21 00:01:36,720 --> 00:01:37,020 All right. 22 00:01:37,890 --> 00:01:39,120 So let's begin, guys. 23 00:01:39,450 --> 00:01:43,200 First of all, let's try to set all the values. 24 00:01:43,230 --> 00:01:45,030 So, first of all, is gross. 25 00:01:46,310 --> 00:01:47,030 Paycheck. 26 00:01:49,060 --> 00:01:54,160 Which is ten thousand dollars that we have health. 27 00:01:56,440 --> 00:02:07,060 Insurance, which is five hundred thirty eight ninety nine, and then we have rent, twelve hundred 28 00:02:07,060 --> 00:02:15,070 and food, we get a discount of half a dollar and then we have tax. 29 00:02:17,190 --> 00:02:23,190 All right, guys, about tax here writes it zero point two, but John, don't remember that this is 30 00:02:24,270 --> 00:02:24,780 in. 31 00:02:26,350 --> 00:02:30,910 Percent's right, this is not a numeric value for money. 32 00:02:31,120 --> 00:02:39,100 It stands four percent and last headline donation for the poor. 33 00:02:41,340 --> 00:02:46,290 And this one is zero point one, and it's also in percent. 34 00:02:50,750 --> 00:02:53,690 All right, so first of all, let us. 35 00:02:57,660 --> 00:03:06,900 Calculate net salary, so the basic math that we need to do here is to, first of all, create a new 36 00:03:06,900 --> 00:03:14,460 variable net salary and that would equals here and will back it will be back in it in a minute, but 37 00:03:14,460 --> 00:03:15,350 before it. 38 00:03:15,810 --> 00:03:18,660 And first, let us create a tax. 39 00:03:20,270 --> 00:03:30,530 Amount in money and do equals here and at stake, the gross salary, the gross paycheck and multiplied 40 00:03:31,550 --> 00:03:40,310 on donation, no, not donations, saurian tax and this would be the tax deduction that we need to do 41 00:03:40,310 --> 00:03:42,920 from our gross paycheck in here. 42 00:03:43,280 --> 00:03:48,080 So this is like a pre calculation for the main mission of our task. 43 00:03:49,550 --> 00:03:57,230 So we have a gross paycheck and let's deduct tax amount in money. 44 00:03:57,830 --> 00:04:02,990 It's right here in the pop up unter and health insurance. 45 00:04:04,710 --> 00:04:08,010 And rent them food. 46 00:04:09,060 --> 00:04:20,670 All right, so let's print it, and this would be our net salary and let's do a plus here. 47 00:04:21,030 --> 00:04:28,350 And as you recall from previous lectures, as we have a print here so we can have only one type here 48 00:04:28,350 --> 00:04:29,150 instead of print. 49 00:04:29,430 --> 00:04:31,660 So here we have a string. 50 00:04:32,100 --> 00:04:32,510 All right. 51 00:04:32,520 --> 00:04:35,340 But now we want to insert a number in here. 52 00:04:35,820 --> 00:04:41,320 But it will give us an error, of course, because we have a integer and here we have a string. 53 00:04:41,640 --> 00:04:50,160 So what we need to do is to convert it to string, uh, with a special keyword and brackets around it. 54 00:04:50,520 --> 00:04:52,290 And let's try to print it. 55 00:04:55,480 --> 00:04:56,200 All right. 56 00:04:57,570 --> 00:05:04,520 So there you have it, this is Yonath salary, reduced all of the expenses, including tax in percents 57 00:05:04,530 --> 00:05:05,610 that we did right here. 58 00:05:06,750 --> 00:05:07,140 All right. 59 00:05:08,200 --> 00:05:15,360 So let's go further to calculating the donation to poor. 60 00:05:16,830 --> 00:05:17,940 Taken from. 61 00:05:20,010 --> 00:05:20,930 That salary. 62 00:05:22,230 --> 00:05:30,840 So as you can guess, we already did some kind of math action here that is really similar, of course, 63 00:05:30,930 --> 00:05:38,940 regarding the donation amount, and I would like you to try to guess what is the similar math calculation 64 00:05:38,940 --> 00:05:45,840 that we did in this call that is really similar to calculating the donation to the poor out of the net 65 00:05:45,840 --> 00:05:46,320 salary? 66 00:05:48,930 --> 00:05:53,350 All right, so this is the answer, guys, because it's the same thing here. 67 00:05:53,700 --> 00:05:56,520 This is in percentage and this is also in percentages. 68 00:05:56,520 --> 00:05:59,880 So the calculation would be similar, right. 69 00:06:00,930 --> 00:06:13,890 So we just need to make a new variable called donation amount equals and then take our net salary and 70 00:06:13,890 --> 00:06:17,070 multiply it with a donation to the poor. 71 00:06:19,020 --> 00:06:24,540 And that sprint it sprint and then donation. 72 00:06:26,620 --> 00:06:29,920 Amount in money. 73 00:06:31,490 --> 00:06:32,690 Will be plus. 74 00:06:34,920 --> 00:06:42,120 Donation amount and also we need to make it a string, as we did before. 75 00:06:43,540 --> 00:06:45,550 All right, so it's printed. 76 00:06:46,290 --> 00:06:47,400 So there you have it. 77 00:06:47,430 --> 00:06:49,120 So this is the donation amount. 78 00:06:49,290 --> 00:06:50,400 It's not the amount. 79 00:06:50,730 --> 00:06:51,510 It's amount. 80 00:06:54,180 --> 00:07:00,540 So this is the donation amount and calculated out of the net salary. 81 00:07:00,990 --> 00:07:02,490 And that's about it, guys. 82 00:07:02,500 --> 00:07:06,330 So we had a mixture here of all concepts regarding numbers. 83 00:07:07,140 --> 00:07:09,120 And we have integer numbers here. 84 00:07:09,130 --> 00:07:10,650 We have a float numbers. 85 00:07:10,650 --> 00:07:15,680 We have pissants here and we have calculated the mix of them. 86 00:07:15,960 --> 00:07:23,250 So we have here float a float result and also you float result here because we can see it's numbers 87 00:07:23,250 --> 00:07:32,820 Bastad decimal and you can sleep calmly tonight because I assure you that now you know your stuff among 88 00:07:33,420 --> 00:07:35,220 integer and float variables. 89 00:07:35,400 --> 00:07:36,830 And that's amazing, guys. 90 00:07:36,830 --> 00:07:42,660 So it's great progress because it's a really important part of the course to know how to manipulate 91 00:07:42,660 --> 00:07:43,230 numbers. 92 00:07:43,650 --> 00:07:46,830 And I'm very happy that we are done with this part. 93 00:07:46,830 --> 00:07:49,110 And let's go over to the next topic.