OK, in this lecture, we're going to use Who Wants to Be a Millionaire for a programming task.
We are not going to use the question that was used in Saturday Night Live comedy show.
I cannot pronounce the volcano's name either.
Neither the name of the cities, by the way, the right answer is a now.
Let's move on my question for one dollar.
The question is, who is named as the father of the lightbulb?
A, Nikola Tesla, B, Mercury, C, Thomas Edison, or D, Robert Oppenheimer.
Your task here is to create a new class who wants to be a millionaire at define a variable with the
right answer.
Print out the question, then your answer.
After that, use contraflow to decide whether your answer was right or not and print out something if
it was right and another one.
If you were wrong, I would recommend you to post a video here and try to do it on your own.
Then if you are finished, start the video again and see how I solved this task.
All right, so we are back to A.J. Let's create a new class called Who Wants to Be a Millionaire app.
So right click new Java class, Who Wants to Be a Millionaire?
And to copy a main method.
From here.
Pasted here and now let's define the answer variable, so cha answer equals simple codes and see, because
Thomas Edison is the right answer and a semicolon now brings up the question.
It's a system that allows print double quotes, who is named as the inventor of the light bulb.
Now print out your answer.
Double quotes you it plus I saw.
Plus, Tovo, Cotes, IDOT, let's
see whether you are right.
Now, the if statement if.
Answer equals
simple code, see curly braces hit enter.
System that our Dr. Winterland, Toppo Cote's, you were right.
You won one dollar.
Health
system that all the prenatal and sorry, but the right answer is Thomas Edison, thank you for
coming.
Now we're an hour called.
Yeah, it's fine, we won't Mundulla, it works perfectly.
So that's it if you uSwitch but also a good way to solve it.
If you don't understand something here, feel free to ask me, see in the next lecture.