All language subtitles for 021 Shopping Cart – Part 4 (Tasks 2 and 3)_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

For this solution to recovery tasks, two and three, the next Castells is to make sure tax is calculated

correctly.

I'm going to read a unit has named taxes valid.

In our test asserts the tax were expecting three point nine.

Is equal to the tax that gets returned when we pass a 30 dollar subtotal and to get tax.

And now inside cadaverine to write code to make the test fail public double.

Get tax.

Double subtotal.

And I'm going to return fire for now.

Run the unit test, then it fails.

Good.

Now we just write code to make sure it passes.

I'm going to multiply subtotal by point one three, because that is the tax rate from the requirements

and ideally the test should pass, but it doesn't because double digit keeps going on forever when you

multiply them.

However, we only want two decimal places.

So we're going to create a new object of the decimal format class.

And decimal format is going around our double to two decimal places.

And to remember that decimal format objects have a format method they can call that converts our number

or that around is our number, I should say, to the expected number of decimal places.

However, it returns a string and you'll also remember that the rapper double has a past double method.

Pass double passes a decimal value out of a string.

Let's rerun the test.

And it passes awesome, can this code be any simpler?

Nope, so we're done refactoring onto the next case of our unit test is going to make sure the total

calculates correctly.

So I'm going to create a unit test named Total as valid.

An artist is going to assert the total we're expecting ninety six point six seven.

Is equal to the total that gets returned when we pass in a subtotal of eighty five point fifty five.

And attacks of eleven point one to.

OK, now back in Kageyama, I'm going to write code to make our test fail public double get total.

They received the subtotal and attacks.

Inside will return zero.

Let's make sure the test fails.

It does now good to write code to make it pass, which would just be us returning the addition of both

parameters around the unit test.

And it passes gret.

Is there anything else we can do here?

I doubt I can get any simpler than this.

All right, we don't have any more methods to unit test, but we still haven't fulfilled this requirement.

We need to return a receipt.

So what I'm going to do is find a method named Checkout's that returns a string.

And it's going to return a receipt that calls every method we just created, I'm sure there's a template

we can copy over.

And here it is, and it's already been done for us, that's pretty cool.

There's nothing to unit test here, it's just a string, so we're all done part for it.

But I want you to compare the old code that we wrote in the previous section to the one we have right

now.

This code isn't good because it performs way too many tasks.

Our other methods are very long and messy.

This code is also impossible to test, so it's vulnerable to bugs.

Our new code is more polished.

Each method performs one task.

Each method is modular, and it's easy to test.

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