WEBVTT 00:00.220 --> 00:01.420 Well I've already separated. 00:01.440 --> 00:04.540 No indeed it's in the violable section of the course. 00:04.540 --> 00:09.530 Well talk of a how to calculate how many digits and no house in the wild section. 00:09.590 --> 00:14.900 Now you create our first lards and at the same time important program the process of creating these. 00:14.940 --> 00:18.350 We will use the previous products that we have developed. 00:18.370 --> 00:19.440 DAY TO DAY. 00:19.500 --> 00:26.440 EVERY invited a number from the user in converted into unmarry. 00:26.490 --> 00:28.910 In every cell of the irey you will have. 00:28.950 --> 00:30.170 And they did of these. 00:30.170 --> 00:30.770 No. 00:32.020 --> 00:37.860 So zero position with four then two six and two. 00:38.500 --> 00:43.290 A highly comments to pause the video of this problem and try to solve it yourself. 00:43.330 --> 00:48.250 So let's assume that we already know how many indeeds it's recovered from the algorithm that we already 00:48.250 --> 00:51.360 created for example for this number of wico forwarded. 00:51.400 --> 00:56.640 Side note don't forget to save all of this programs in the library of God in the future. 00:56.780 --> 01:00.910 If you remember except from the number of days did we cover one more right. 01:01.080 --> 01:06.130 That the E C which also represents how many. 01:06.250 --> 01:07.270 The number has. 01:07.310 --> 01:11.500 Let's use an example of the number four hundred and fifty two. 01:11.500 --> 01:13.160 So three digits. 01:16.780 --> 01:20.930 There you see here is equal to one thousand. 01:21.420 --> 01:24.950 So we can use this violable in order to dig up out of the number. 01:25.020 --> 01:30.450 We will use a little bit that divides the number with the E C in the X in the two part lag the first 01:30.450 --> 01:32.050 algorithm in the variable sex. 01:32.130 --> 01:37.410 So the first thing can be lobe is to divide D E C with N. 01:37.770 --> 01:44.130 This makes the number one hundred n then as we already talked about divide then number or a hundred 01:44.130 --> 01:51.250 and fifty two for example with 100 This create the number four call 50 to intervene. 01:51.290 --> 01:53.060 That part is false. 01:53.290 --> 01:56.090 Then we need to take our number out without the form. 01:56.130 --> 02:01.300 So four hundred and fifty two minus four more divide by the. 02:01.340 --> 02:04.500 You see this is then 100. 02:04.800 --> 02:07.040 So the result is 52. 02:07.140 --> 02:12.630 If you have a problem other then to this Eugene go back into remember it from the variables section 02:12.720 --> 02:14.520 n then really start all over again. 02:14.550 --> 02:19.710 Divide the E C with 10 and we get the number 10. 02:19.830 --> 02:25.970 Divide fifty two with the C word create 5 comma tool. 02:26.110 --> 02:28.050 Then the 10 part of is. 02:28.220 --> 02:32.330 And then 52 minus 5 multiplied by 10. 02:32.430 --> 02:33.650 That is aldis too. 02:33.960 --> 02:36.110 But this is kind of confusing theory. 02:36.150 --> 02:43.110 So let's try to create that axiom called flexible initialized and number two for a hundred and fifty 02:43.110 --> 02:43.720 two. 02:43.870 --> 02:50.460 N then we will use this same exact algorithm in order to calculate the it's in the DC. 02:50.520 --> 02:54.850 If you want to remember it you didn't go to the wild section and find the algorithm there. 02:54.960 --> 02:57.270 So let's try it out. 02:57.270 --> 02:59.020 The result is. 02:59.120 --> 03:04.640 You did correct and one thousand that D C is incorrect. 03:04.680 --> 03:12.230 So every time again we need to divide the C with then in before we start the Y loop. 03:12.240 --> 03:21.540 We need to create a narey that saves all the numbers so it's a is equal at least and then dillies of 03:21.540 --> 03:27.240 course and the Y look we don't really thought about what we will use in the while loop in we will have 03:27.240 --> 03:34.140 it empty handed we think an idea now will create and then point Ari out of all of these units in a number 03:34.410 --> 03:38.050 of the number divided by the e c as were. 03:38.050 --> 03:40.290 I did ok about the analysis N.. 03:40.390 --> 03:41.340 Did do Ari. 03:41.670 --> 03:45.950 We love paint for dembrow divide it will also win it. 03:45.960 --> 03:54.240 However the new number so number is equal to a number in the subtracted by that dimple not a viable 03:54.330 --> 03:56.530 multiplied by D E C. 03:56.560 --> 03:59.050 Like the analysis under 1 not. 03:59.080 --> 04:04.380 Finally D E C used to see you right by 10 as always. 04:04.430 --> 04:12.090 Now if we divide D C again again we will go from one thousand to 100 from one hundred to 10. 04:12.090 --> 04:15.610 From 10 to 1 so we can write here. 04:15.760 --> 04:20.130 The C is equal to 1 is the C is equal to 1. 04:20.130 --> 04:24.510 This means that the whole procedure is and then we can put in their results. 04:26.750 --> 04:29.270 Let's try and see the results. 04:31.690 --> 04:38.380 So okay the problem seems to be here are not equal to one because we all have one thousand and we need 04:38.380 --> 04:39.250 to do the law. 04:39.400 --> 04:41.240 Then one hundred then ten. 04:41.260 --> 04:43.570 And you know this number is really to do the look. 04:43.780 --> 04:46.830 So when is this equal to one we would enter the loop. 04:46.930 --> 04:50.200 As you can see here we're only then numbers four and five. 04:50.220 --> 04:53.140 So we also need to do the law. 04:53.180 --> 04:54.620 When ever there were no. 04:54.730 --> 05:02.530 So what does the number of D.C. After one you were one in developing here we will divide D.C. with then 05:02.530 --> 05:04.600 so we will see Utah come out one. 05:04.690 --> 05:05.700 Let's try that. 05:08.890 --> 05:11.020 As you can see here the results are correct. 05:11.020 --> 05:17.830 So from this problem you can take that sometimes we need to do some tie in there and find the correct 05:17.830 --> 05:20.280 result from that particular problem. 05:20.290 --> 05:24.410 This seems correct and does always keep in guys.