In this video, I want to present to you the application that we're going to build in the next few videos.
And it is a quiz app, and we're going to need everything that we've learned so far, at least almost
everything.
And we're also going to learn a few new keywords and things along the way, which is why it's not only
important for you to watch this if you want to learn new stuff, but also if you want to really make
sure that you understood everything so far.
So what we have here is a little quiz where it says welcome to the quiz.
And we have question number one.
And then it says what is the capital of France.
And I have four choices.
I'm going to say Paris is the capital of France.
Then I have the second question.
What is two plus two?
And the answer is four.
But I'm not going to enter four.
I'm going to enter two because two is where we have four.
So this is a very tricky one can catch you off guard very easily.
And then who wrote hamlet.
And I'm going to say Shakespeare.
And there we are.
I get my results where it says quiz finished.
Your score is three out of three.
Three correct answers out of three questions.
Excellent work.
So I also, by the way, made a small change to the layout of my console.
Here you can see I increased the font size as well as the layout.
So this is in German.
But basically these are the values that you can use here as well.
So let's look at how this project is structured.
So what we have is we have obviously our program CSS file which is our main class.
And in this we're going to have a bunch of questions.
So how do they look like.
We will see later.
You can try to build this obviously yourself.
But you can see we are using question which is a class that we're creating ourselves.
So you can see that here.
So we're going to create question as well as quiz.
So how can we create an array of question.
Well that's something we will see later on.
But you see the new keyword is very important in this context okay.
Then we're going to have our question.
And the question is quite simple.
You can see here we just have a property question text.
Then some answers which is an array of string.
And we have correct answer index.
And by the way we're going to build all of this step by step.
So don't worry about it.
You don't need to see like understand all of that.
I just want to give you an idea as to what is important when you want to build such an app.
And then we're going to build it together step by step.
I'm going to give you the instructions as well so you can follow along very easily.
Then we have a question constructor obviously where we need to set all of these values accordingly.
And we have this boolean which will give us the information about whether we selected the correct answer
or not.
So I'm not going to show you what the content of these methods is.
Then the most important class will be our quiz class where we have a bunch of questions.
So you see here this question that we created.
We need to use a bunch of them.
Then we're going to have a score.
So we are going to collect the score and always add up.
If we answered correctly.
Then obviously our constructor here in line 14 and in line 20 we're starting the quiz, whatever that
means.
Then we need a method that will display the questions we need.
Wanted displays the results, and we need to get the user choice.
And then in the end we can combine all of that here where we start the quiz and then everything else
goes from there.
Okay.
So this is just to give you an overview as to what the quiz entails and what you are going to need for
that.
You see, we're going to create two extra classes and we're going to use them very efficiently here.
So I'm really excited about that.
And let's get started building this project together.