1 00:00:00,524 --> 00:00:04,246 You've learned a lot about JavaScript so far, variables, strings, numbers, and 2 00:00:04,246 --> 00:00:05,680 conditional statements. 3 00:00:05,680 --> 00:00:09,400 In fact, you learned enough to put together complete programs. 4 00:00:09,400 --> 00:00:12,740 So let's wrap this course up with a little simulation that will produce a working 5 00:00:12,740 --> 00:00:15,950 program that utilizes most of your newfound JavaScript knowledge. 6 00:00:17,490 --> 00:00:21,210 For this exercise, I want you to write a simple quiz application. 7 00:00:21,210 --> 00:00:24,171 Let's have a look at what you'll need to do. 8 00:00:24,171 --> 00:00:27,878 Launch the new workspace with this video to access the starter files for 9 00:00:27,878 --> 00:00:28,819 this challenge. 10 00:00:28,819 --> 00:00:32,208 Open the quiz.js file located inside the js folder, 11 00:00:32,208 --> 00:00:34,929 this is where you'll write all your code. 12 00:00:34,929 --> 00:00:38,690 And the file is already linked to index.html. 13 00:00:38,690 --> 00:00:41,860 I've provided the instructions for this challenge as JavaScript comments. 14 00:00:41,860 --> 00:00:45,994 So let's go over the tasks your application needs to perform. 15 00:00:45,994 --> 00:00:48,895 The quiz app should ask at least five questions, 16 00:00:48,895 --> 00:00:52,910 you'll store the answer to each question in a variable. 17 00:00:52,910 --> 00:00:56,570 It also needs to keep track of the number of questions the user answered correctly 18 00:00:56,570 --> 00:00:57,720 using a variable. 19 00:00:57,720 --> 00:01:01,710 And here's a hint, the addition assignment operator can help you with this. 20 00:01:01,710 --> 00:01:05,130 For example, if a user provides the correct answer, 21 00:01:05,130 --> 00:01:09,470 use reassignment to assign the current number of correct answers 22 00:01:09,470 --> 00:01:13,220 plus one to the variable you declare here in step one. 23 00:01:15,500 --> 00:01:18,450 Then it needs to rank the player. 24 00:01:18,450 --> 00:01:24,030 If the player answered all five questions correctly, give that player a gold crown. 25 00:01:24,030 --> 00:01:29,750 Three to four is a silver crown, one to two correct answers is a bronze crown, 26 00:01:29,750 --> 00:01:32,150 and zero correct is no crown at all. 27 00:01:32,150 --> 00:01:36,169 Keep track of the ranking with the variable you declare here in step two. 28 00:01:38,575 --> 00:01:42,763 Finally, the app should show a final message on the page after the quiz, 29 00:01:42,763 --> 00:01:47,250 letting the user know the number of questions they got right and the ranking. 30 00:01:47,250 --> 00:01:49,240 You can display the ranking below or 31 00:01:49,240 --> 00:01:52,870 next to the number of correct answers, for instance. 32 00:01:52,870 --> 00:01:57,490 Notice how you're asked to select the main element in index.html. 33 00:01:57,490 --> 00:01:59,385 This is where you'll display the final message. 34 00:02:05,418 --> 00:02:08,111 The goal is to get your quiz app to work similar to this. 35 00:02:10,361 --> 00:02:14,131 In the next video, I'll show you how I would program this challenge. 36 00:02:14,131 --> 00:02:15,251 Good luck and have fun.