All language subtitles for 013 Shopping Cart – Part 9_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
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
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

The last step is to bulletproof the application, we're going to make sure the application doesn't fail

or crash no matter what happens right now, there are many places where unchecked exceptions could be

thrown during the runtime and cross the application, but we can't allow that to happen.

Let's run the app.

And the first vulnerability is if the user enters the wrong and put the Atheros in input mismatch exception.

And if we get an unchecked exception, it means we have to improve our code.

And what we're missing is code that anticipates a scenario where the user may enter a value that is

not an integer.

So what I'll do is I'll apply conditional assignment here, I'll check if scanned on has next and if

the next thing the user inputs is an integer, then we'll pick up the input using next and otherwise

we'll assign it the value of 404.

And how convenient is it that we already have a next line right here?

Because if 404 returns, we still need to pick up the input.

Otherwise things are going to get out of whack and next line can pick up anything.

So that's perfect.

Same thing here, if the next input that scanner reads is an integer.

Then we'll pick it up, otherwise we'll just assign the value for for.

And now before creating the object, I'll just say if either value is Foro for.

Then just restart the wire loop.

Rewriting the code.

I'm going to say, don't know how beautiful.

And the next vulnerability in the app is if the user index is outside the bounds of the array and the

app throws an array index out of bounds, exception, unchecked exceptions are the result of badly written

code.

And what we're missing in the code is logic that anticipates the user indexing on a bounce.

So what I'll do is I'll see if the aisle number is smaller than zero or bigger than six.

Or if the column number is smaller than zero.

Or bigger than two.

Then the user is indexing outside the bounds of the array, so we have to restart the loop.

If I index outside the bounds of the array, it just restarts the loop and doesn't crash, perfect.

Last thing we might get is an illegal state exception if I try to remove from an empty cart, the app

is going to throw an illegal state exception.

This exception is thrown by the remove method, and that's because we shouldn't be calling the remove

function when there's nothing in the cart that's just bad and I'm glad it crashed.

It means we get to improve our code.

So I'm going to add a method that returns a bullion named is empty.

And it's going to return a boolean that indicates if the array list is empty.

So back here, I'll say.

If Kurt.

Is empty.

I'll restart the while loop.

Try to remove from an empty cart.

And we're all good.

Now, what if I tried to check out an empty cart this time, the checkout method throws an illegal STD

exception.

That's because our app is calling checkout when there is nothing inside the cart.

And that's just bad code.

It's telling us to improve our code.

So once again, will check.

If Kurt.

Is empty.

Then restart the wire loop.

And with this final line of code, I'm proud to say we're done building the shopping cart application,

I'm going to run the app.

And now I can just keep playing around with it with full confidence that it's always going to work.

And it's going to keep letting me do my shopping, this app is really rewarding because it involves

everything from two to you raise.

We created objects of three different classes and we made them work together.

We implemented exception handling, you learn how to write an equals method to compare it to objects,

you've come this far and I hope you're proud of yourself.

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