Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Practice Input and Output in Java!
You have completed Practice Input and Output in Java!
Preview
Explore the project
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Hey, welcome to this practice session.
0:09
Practice is an excellent way to make sure
what you've been learning is sticking.
0:12
In this session,
we'll be practicing doing I.O.
0:16
Now remember,
that stands for input and output.
0:20
Taking input from the user
and outputting it to the console.
0:23
If you haven't done so already,
I recommend to check out our Java
0:28
Basics course.
0:32
This will ensure that you have the proper
skills to complete this practice.
0:33
Now, I've attached a new workspace
to this video, and it looks like this.
0:37
A basic shell of a Java application.
0:42
I've also gone ahead
and imported the console object for you.
0:45
It's all ready for you to use.
0:48
So, in order to do this practice,
the idea is
0:51
that you're going to read through
these to-dos here and complete them.
0:53
The point of this little program
is to be a greeter to someone
0:57
entering the place of your choosing.
1:00
You know, like how some stores have people
that greet you when you come in.
1:01
I have prepared an example project.
1:06
I'm not going to show you the code.
1:08
It's hidden underneath the console.
1:09
So what going to happen
you notice that the file is called greeter
1:11
So we going to compile it right
1:16
We going to clear the screen, compile it,
1:18
and then we going to run it
1:21
So this is what it looks like
when it runs.
1:26
It will ask for my name,
so I'll enter Laura.
1:29
And it says, hello Laura,
welcome to Kwik E Mart,
1:32
because Kwik E Mart is what I chose.
1:35
Let's take a look at those to-do's
real quick.
1:37
For this first to-do,
it says create a new string named place
1:40
and assign it a value of your choosing
so the example I chose Kwik E Mart
1:45
so then I provided you
the console object like we talked about
1:51
and we want to prompt the user
what is your name
1:54
and store that in a new variable
1:57
and then finally
we want to print out to the console
2:00
hello first name welcome to the place
you chose all using those variables
2:03
this This might seem
like a fairly simple application, but it's
2:08
great practice in recalling the syntax
and flow of the application.
2:12
If you can't quite get it, don't fret.
2:16
I show how I did it in the video right
after this, but please do give it a try.
2:18
That struggle to remember the syntax
and structure is well worth it.
2:23
That recall will pay off in the long run.
2:28
It's just like muscles,
no pain, no gain for your brain.
2:31
You got this.
2:34
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up