1 00:00:02,340 --> 00:00:07,110 OK, in this lecture, we're going to use Who Wants to Be a Millionaire for a programming task. 2 00:00:07,300 --> 00:00:11,560 We are not going to use the question that was used in Saturday Night Live comedy show. 3 00:00:11,610 --> 00:00:14,400 I cannot pronounce the volcano's name either. 4 00:00:14,940 --> 00:00:20,040 Neither the name of the cities, by the way, the right answer is a now. 5 00:00:20,040 --> 00:00:22,180 Let's move on my question for one dollar. 6 00:00:23,010 --> 00:00:27,450 The question is, who is named as the father of the lightbulb? 7 00:00:28,290 --> 00:00:36,390 A, Nikola Tesla, B, Mercury, C, Thomas Edison, or D, Robert Oppenheimer. 8 00:00:37,420 --> 00:00:43,690 Your task here is to create a new class who wants to be a millionaire at define a variable with the 9 00:00:43,690 --> 00:00:44,730 right answer. 10 00:00:45,010 --> 00:00:48,190 Print out the question, then your answer. 11 00:00:48,310 --> 00:00:56,230 After that, use contraflow to decide whether your answer was right or not and print out something if 12 00:00:56,230 --> 00:00:58,360 it was right and another one. 13 00:00:58,360 --> 00:01:04,770 If you were wrong, I would recommend you to post a video here and try to do it on your own. 14 00:01:04,900 --> 00:01:10,900 Then if you are finished, start the video again and see how I solved this task. 15 00:01:13,580 --> 00:01:19,850 All right, so we are back to A.J. Let's create a new class called Who Wants to Be a Millionaire app. 16 00:01:19,850 --> 00:01:31,400 So right click new Java class, Who Wants to Be a Millionaire? 17 00:01:35,180 --> 00:01:37,590 And to copy a main method. 18 00:01:39,900 --> 00:01:40,740 From here. 19 00:01:44,930 --> 00:01:59,270 Pasted here and now let's define the answer variable, so cha answer equals simple codes and see, because 20 00:01:59,270 --> 00:02:04,130 Thomas Edison is the right answer and a semicolon now brings up the question. 21 00:02:05,090 --> 00:02:18,500 It's a system that allows print double quotes, who is named as the inventor of the light bulb. 22 00:02:22,760 --> 00:02:24,800 Now print out your answer. 23 00:02:27,870 --> 00:02:33,980 Double quotes you it plus I saw. 24 00:02:36,280 --> 00:02:40,570 Plus, Tovo, Cotes, IDOT, let's 25 00:02:43,180 --> 00:02:48,000 see whether you are right. 26 00:02:54,990 --> 00:02:57,180 Now, the if statement if. 27 00:02:58,900 --> 00:03:01,780 Answer equals 28 00:03:04,450 --> 00:03:08,650 simple code, see curly braces hit enter. 29 00:03:10,310 --> 00:03:16,190 System that our Dr. Winterland, Toppo Cote's, you were right. 30 00:03:19,010 --> 00:03:21,920 You won one dollar. 31 00:03:26,010 --> 00:03:26,670 Health 32 00:03:29,190 --> 00:03:46,200 system that all the prenatal and sorry, but the right answer is Thomas Edison, thank you for 33 00:03:49,170 --> 00:03:49,770 coming. 34 00:03:50,700 --> 00:03:51,720 Now we're an hour called. 35 00:03:52,740 --> 00:03:56,730 Yeah, it's fine, we won't Mundulla, it works perfectly. 36 00:03:57,210 --> 00:04:01,220 So that's it if you uSwitch but also a good way to solve it. 37 00:04:02,200 --> 00:04:07,120 If you don't understand something here, feel free to ask me, see in the next lecture.