All language subtitles for 005 if statements_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
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

If statements can use comparisons to control the flow of your code, a comparison is only useful when

it's inside of an IF statement.

So in this lesson, you're going to use statements to control how your code runs.

As usual, we're going to start by creating a new class inside the Section three folder, create a new

file named FLC Java and make sure the class has a main method.

The if statement runs, it's code only if a condition is true.

This is a comparison, but when a comparison is inside of a statement, we call it a condition.

There are two parts to in a statement, the condition which can be true or false and the code inside

which only runs if the condition is true.

So inside of Java, we're going to make an invariable that stores a student's grade into grade is equal

to 65.

Then we're going to make an if statement if and inside the brackets, we're going to read a condition

that checks if a grade is greater than 50.

And inside the if statement, we're going to print.

Great job.

You passed.

This code will only run if the condition is true.

So we're going to run our code.

And it ran the code inside the statement.

That's because the grade 65 is bigger than 50, which makes the condition true.

So the code inside the if statement runs.

Now we're going to change the students grade to 45.

Rewrite our code.

And nothing happens.

The grid is not bigger than 50, which makes the condition false.

So Java skips the code.

When the if condition is false, Jova runs the false statement.

And if a statement looks like this, there is an if statement with a condition and an el statements.

And when the condition is true, Juvy runs the estimates.

And when the condition is false, Java skips the statement and runs the code inside else.

So back in our code, if a student scores under 50, we want the app to say study hard next time, so

we're going to add an else block.

And inside will print study hard next time.

Rerun your code.

And this time the code inside the statement runs, never going to change the grade back to 65.

We run your code once more.

And this time at Prince, great job you passed.

We need to be careful about putting in the right condition, let's assume that if 50 percent warrants

a pass, but our condition checks if the grid is greater than 50.

I'm going to change the grade to 50 and see what happens, rewriting my code.

And that's not good, the condition is false.

So the student fails.

We need to fix our conditions is that the student policies, if they're great, as greater than or equal

to 50.

Let's rerun the code.

And right on the student pass with a D minus.

In this case, the grid is equal to 50, so the condition is true and this runs the code inside the

statements.

In this lesson, you learn to use if statements to control how your code runs.

When the condition is true, Jova runs the if statements.

When the condition is false, Java skips the statement and runs the code inside ls.

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