All language subtitles for 20. Exercise 4 - Reading numbers from a file [Solution]

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,930 --> 00:00:05,980 All righty, so I hope you've given it a little bit time on your own to solve it. 2 00:00:06,120 --> 00:00:11,160 Now we are going to do it together, so let's modify here in the open. 3 00:00:11,160 --> 00:00:14,850 Instead of writing, we will read from this file. 4 00:00:14,880 --> 00:00:15,360 Right. 5 00:00:15,390 --> 00:00:19,800 So the the the the working mode should be reading from a file. 6 00:00:20,460 --> 00:00:24,210 F.P. will point to this file and we will be able to read from it. 7 00:00:25,080 --> 00:00:26,400 So how should we read? 8 00:00:27,290 --> 00:00:28,130 What do you think? 9 00:00:28,560 --> 00:00:30,720 What do you think should be specified here? 10 00:00:31,320 --> 00:00:39,670 Well, basically we should iterate also over some for a loop, let's say equals to one eye is long is 11 00:00:39,690 --> 00:00:48,690 less than or equal to ten and I plus plus OK, inside of these for a loop, we are going to do two things. 12 00:00:49,410 --> 00:00:54,060 The first thing that we are going to do is to read the information stored there. 13 00:00:54,570 --> 00:01:02,490 How are we going to do it using the F Cunniff function now we are going to specify here what is it expect 14 00:01:02,490 --> 00:01:06,060 to receive a pointer or to file, which is F.P.. 15 00:01:06,810 --> 00:01:10,200 Vaneta expects to receive some format. 16 00:01:10,200 --> 00:01:13,200 Right, similar to how the printed function works. 17 00:01:13,500 --> 00:01:17,010 So let's use your percentage and percentage the. 18 00:01:18,370 --> 00:01:24,500 Reading to values of an integer type and storing them inside, what are should we store them? 19 00:01:24,520 --> 00:01:31,060 Let's create also variables and let's call it ain't number one and number two. 20 00:01:32,120 --> 00:01:39,020 And now we are going to come here and specify store them inside the address of number one and inside 21 00:01:39,020 --> 00:01:40,310 the address of number two. 22 00:01:41,090 --> 00:01:44,180 So reading from these files, where is this file? 23 00:01:44,390 --> 00:01:52,370 Here it is, reading values from here, storing it inside, number one, this one inside them two and 24 00:01:52,370 --> 00:01:57,320 then to inside and one for inside them two and so on and so forth. 25 00:01:57,530 --> 00:01:57,980 OK. 26 00:01:59,240 --> 00:02:03,470 So, yeah, here we return value is ignored. 27 00:02:03,620 --> 00:02:10,280 I, I don't really want to get into this right now, but basically we are just going through this information 28 00:02:10,820 --> 00:02:17,000 and on every iteration, what are we expected to do to print the result to the screen? 29 00:02:17,450 --> 00:02:27,200 So print have a basic print that you already know, read, let's say percentage and percentage and specify 30 00:02:27,200 --> 00:02:29,660 here, I don't know, some backslash and one. 31 00:02:31,780 --> 00:02:41,290 And number two, that's it, that's eight guys reading value by value from the file and printing it 32 00:02:41,290 --> 00:02:42,060 to the council. 33 00:02:42,070 --> 00:02:47,550 So let's see if it corresponds to what I'm saying, one, one, two, four, three, nine and so on. 34 00:02:47,560 --> 00:02:48,960 And here is the file. 35 00:02:49,390 --> 00:02:53,120 You can see that they are almost identical, right? 36 00:02:53,140 --> 00:02:54,910 They are identical, actually. 37 00:02:54,910 --> 00:02:55,330 One one. 38 00:02:56,410 --> 00:02:57,240 So, yeah. 39 00:02:57,730 --> 00:03:04,120 Now, you know, and you practice a little bit on your own how the F scanner function works. 40 00:03:04,120 --> 00:03:09,550 Very important that you will know the syntax, that you will know what come to you for what comes after 41 00:03:09,550 --> 00:03:10,810 and so on and so forth. 42 00:03:11,700 --> 00:03:17,880 So, as always, thank you guys for watching, keep on practicing and let's move on. 43 00:03:18,000 --> 00:03:19,000 My name is Vlad. 44 00:03:19,350 --> 00:03:20,400 This is Alphatech. 45 00:03:20,610 --> 00:03:21,330 Enjoy. 4277

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.