All language subtitles for 049 Contacts – Part 6, Task 4 (Solution)_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

In the first video, we implemented tasks one, two and three, and we loaded all the contacts into

the contact list except for Geo, because her birthdate isn't valid.

Now on to the final task for part six, which is to create a function named at manage contacts.

We're going to be interacting with the user and managing our contacts through this function.

So I'm going to start by creating a new object of the scanner class.

This scanner object is going to receive input from the system.

System in.

And the Java Dark tells us to create an infinite loop.

So we'll do just that.

And we need to ask the user to add or remove a contact or exit.

I'm just going to copy what we have from the workbook.

And after asking the user for their response, we're going to pick it up using scanned next line.

Kano if their response happens to equal a.

We're going to copy the following from the workbook, which further prompts the user for their name,

phone number and birthdate.

Then we're going to pick up every answer using scanned next line.

And now from the information they provided, we can add a new contacts manager and contacts.

And we'll create a new contact from the name.

Number and birth date that they passed in.

Here, we get an error.

That's because the contact constructor can throw a pass exception.

A pass exception is a checked exception.

So if you want to call this constructor, job is going to force you to try to run the code.

And if the code happens to fail, you need to catch the pirates exception.

And we'll just print the message that comes out of it.

All right.

And after writing the contact, the article tells us to use a finally blocked print.

Updated contact.

Followed by the updated list of contacts.

That's all for case.

If it's case B and they want to remove a contact.

Then we'll just ask them who they'd like to remove.

Then we can call a manager and remove contact and remove whatever name value the user.

Paston.

All right.

And if the user chooses C or anything else, really just break the loop.

And after the wire loop, don't forget to close scatter.

All right, now, back in the main method, we can call manage contacts.

I see that.

I've called that managed contact.

Let me just make sure it's plural.

Think we're now ready to test each case.

I'll start by testing, Casey.

I'll add another contact named Zack.

With a phone number of 111, two, two, two, three, three, three and with a birth date of 12, 12,

1995.

Next thing I'll do is remove a contact.

I'll remove Zack.

And woops, forget the print, the updated contact after removing them.

Let's try it again.

All that dark again with the same phone number as before.

Same birth date.

And get.

Just like that.

Zach has gone.

Finally, I'll just exit.

And that's all for adding interactivity to the application.

If you want to visualize what's going on, feel free to add breakpoints and launch the debugger.

Otherwise.

I hope you're ready for part seven.

I'll see you in there.

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