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,720 --> 00:00:13,720 This video will present the solution to workbook 2.4. 4 00:00:13,750 --> 00:00:18,330 From Vsco We don't need to launch the exact folder that contains my Java file. 5 00:00:18,340 --> 00:00:21,640 In this case, the folder is called Workbook 2.4. 6 00:00:22,270 --> 00:00:22,840 All right. 7 00:00:22,870 --> 00:00:29,950 Task number one is to convert each decimal to a whole number before printing it as part of a much larger 8 00:00:29,950 --> 00:00:30,600 string. 9 00:00:30,610 --> 00:00:36,510 So let's start off by breaking up this string such that we can embed values inside of it. 10 00:00:36,520 --> 00:00:39,250 Here we will embed the sales value. 11 00:00:41,730 --> 00:00:44,550 Here, we can embed the profit value. 12 00:00:48,330 --> 00:00:49,590 Refunds. 13 00:00:52,630 --> 00:00:56,290 And here we can concatenate the shipping variable. 14 00:01:00,290 --> 00:01:02,390 Okay, Let's go ahead and run it. 15 00:01:02,540 --> 00:01:04,760 New terminal Java. 16 00:01:04,790 --> 00:01:12,800 See, we will compile the code inside of meeting Java and then we can run the compiled code as follows. 17 00:01:13,340 --> 00:01:20,150 And this looks pretty ugly because in the thousands of dollars, do we really care about sense? 18 00:01:20,850 --> 00:01:25,490 Before merging each decimal value into a surrounding string. 19 00:01:25,500 --> 00:01:28,170 We need to convert that value to an integer. 20 00:01:30,560 --> 00:01:31,400 Like so. 21 00:01:39,470 --> 00:01:41,600 INT means hole number. 22 00:01:41,600 --> 00:01:49,820 So by type casting the decimal to an int, all the decimals are going to get cut off and after the value 23 00:01:49,820 --> 00:01:54,650 has been type casted to end, it is then merged as part of a larger string. 24 00:01:54,830 --> 00:01:57,260 So let's go ahead and run our code. 25 00:01:59,550 --> 00:02:01,290 And this looks beautiful.