1 00:00:00,150 --> 00:00:03,840 Before we start, did you try solving the workbook yourself? 2 00:00:03,870 --> 00:00:09,630 If not, please click the link in the resources folder and follow the instructions for this workbook. 3 00:00:10,940 --> 00:00:13,880 This video will present the solution to workbook 2.2. 4 00:00:13,910 --> 00:00:19,340 Before we start, please make sure that you launch the exact folder that contains your Java file. 5 00:00:19,550 --> 00:00:27,440 This folder will be called Workbook 2.2 and Task one was to replace each comment over here with a variable. 6 00:00:27,800 --> 00:00:33,050 So name is text, which means you can store that in a string variable name. 7 00:00:33,140 --> 00:00:37,100 So we'll say string name and I will just use a name of SEM. 8 00:00:38,550 --> 00:00:42,480 Age is represented typically as a whole number, as an integer. 9 00:00:42,480 --> 00:00:47,220 So here I'll say int age and we'll say 35. 10 00:00:48,740 --> 00:00:49,510 All right. 11 00:00:49,520 --> 00:00:52,130 Country and sport represent text. 12 00:00:52,130 --> 00:00:53,600 So I'll say string. 13 00:00:53,630 --> 00:00:57,590 Country is equal to England. 14 00:00:58,370 --> 00:01:02,870 And string sport is equal to basketball. 15 00:01:08,440 --> 00:01:13,510 And ours is typically represented as a whole number, as an integer. 16 00:01:13,510 --> 00:01:18,160 So we'll say int ours is equal to two. 17 00:01:20,060 --> 00:01:23,180 Game and subject are also text. 18 00:01:23,180 --> 00:01:24,710 So we'll say string. 19 00:01:24,890 --> 00:01:28,160 Game is equal to checkers. 20 00:01:29,610 --> 00:01:34,410 And string subject is equal to chemistry. 21 00:01:36,580 --> 00:01:37,420 All right. 22 00:01:38,540 --> 00:01:47,180 And grade, assuming that it can only be A, B, c, D, f, we can represent it as a car, as a single 23 00:01:47,180 --> 00:01:47,900 character. 24 00:01:47,900 --> 00:01:52,310 So car grade is equal to B. 25 00:01:52,400 --> 00:01:58,820 Remember that with characters they must be enclosed in single quotes, whereas strings use double, 26 00:01:58,820 --> 00:02:00,230 quote, enclosures. 27 00:02:00,410 --> 00:02:01,340 All right. 28 00:02:04,400 --> 00:02:08,990 And now Task two is to replace each placeholder with a variable. 29 00:02:09,020 --> 00:02:11,090 We did this in the previous lesson. 30 00:02:11,090 --> 00:02:12,110 Not too hard. 31 00:02:12,140 --> 00:02:14,030 First we break the string. 32 00:02:16,120 --> 00:02:19,840 Two plus symbols and then concatenate your variable. 33 00:02:21,170 --> 00:02:25,460 I'll let you pause the video and repeat this for all other variables. 34 00:02:30,700 --> 00:02:37,750 Once you do that, go ahead and compile your code using Java Sea, Java C biography Java and then run 35 00:02:37,750 --> 00:02:38,950 the compiled code. 36 00:02:40,800 --> 00:02:41,580 Oops. 37 00:02:41,580 --> 00:02:43,830 My bad Java biography. 38 00:02:45,050 --> 00:02:46,300 All right. 39 00:02:46,310 --> 00:02:51,530 And just like that, we created a biography using the provided templates. 40 00:02:52,190 --> 00:02:58,940 We effectively merged the variables that we created with the provided template and in turn created our 41 00:02:58,940 --> 00:03:00,680 own personal biography.