YouSub
Untitled

en English

Untitled English subtitles

0 downloads · 22 lines · added Dec 14, 2015

Report a problem
What's wrong?
Advertisement

English transcript

So far the message already says "Total: and the price, and
we just need to update it so it also says thank you.
I'm going to update the string variable because I want to practice that.
So I'm going to create a new line of code that updates the price message.
And I'm going to just add on to whatever's in the price message string.
And I'm going to add Thank you!
Let's run this on the device.
Okay, if I change the quantity and I hit order, then it says, Total $15Thank you!
And it all runs together without any spaces.
But the thing is, I don't really just want a single space.
I really need it to go on the next line.
If you remember earlier in the lesson, I mentioned escape characters in Java.
Escape sequences are a character preceded by a backslash, and
they mean something special to the Java compiler.
Before we used it to insert a double quote in a string.
Now we can use it to insert a new line in a text.
In the code, I'm going to add \n so
that it creates a new line right before it says Thank you!
When I run the app and change the quality and I hit Order,
then it says Total $15, and then it adds a new line and then it says Thank you!
Yay!
And thank you for doing all the coding tasks in lesson two.

Need subtitles from another video?