1 00:00:03,630 --> 00:00:07,420 In this practice lecture, your task would be to create two functions. 2 00:00:07,860 --> 00:00:14,520 The first one should take a CHA, the energy efficiency category and print out the energy consumption 3 00:00:14,790 --> 00:00:24,450 of each level by using a switch or if as a standard for very low, B is low, C normal. 4 00:00:24,750 --> 00:00:33,450 The above normal is high, F is very high, and G is extremely high energy consumption. 5 00:00:34,020 --> 00:00:41,580 I would suggest you to make the function compatible with lowercase and uppercase char arguments. 6 00:00:41,970 --> 00:00:49,740 Also, I would like you to modify the function to return a string and print out the return string with 7 00:00:49,740 --> 00:00:57,290 a system that Outbrain on the second function should print out a car description and it should have 8 00:00:57,300 --> 00:01:04,800 three parameters string car model and production year and string condition. 9 00:01:05,100 --> 00:01:07,900 It can be good, bad, used or damaged. 10 00:01:08,430 --> 00:01:15,390 I also suggest you to post the video here and try to do this on your own and get back here after you've 11 00:01:15,390 --> 00:01:18,390 finished and compare your code to mine. 12 00:01:18,570 --> 00:01:24,720 If something is not clear for you or you think you have another solution, feel free to share that with 13 00:01:24,720 --> 00:01:26,230 me, OK? 14 00:01:26,400 --> 00:01:28,820 You can create a new class for this task. 15 00:01:29,100 --> 00:01:35,550 I'm going to add the two functions to the functions and class we created in the last lecture. 16 00:01:36,240 --> 00:01:36,720 All right. 17 00:01:36,720 --> 00:01:42,030 Start with static void. 18 00:01:43,800 --> 00:01:59,700 The function name gets energy of efficiency, Prentice's char category, curly braces, and I'm going 19 00:01:59,700 --> 00:02:11,730 to use switchgear service, which it's going to take to category curly braces, case single quotes, 20 00:02:12,180 --> 00:02:13,440 uppercase A.. 21 00:02:14,580 --> 00:02:20,890 And Callon, as I said, it, should able to take lowercase letters as well. 22 00:02:20,910 --> 00:02:22,920 So case. 23 00:02:24,400 --> 00:02:42,430 Simple coats, a hand column now stand out out of print on darbo coats, very low energy consumption 24 00:02:45,940 --> 00:02:58,420 and break and a semicolon now copied these lines, copy paste it here and again. 25 00:02:58,630 --> 00:03:00,460 And again and again. 26 00:03:02,020 --> 00:03:08,620 Change A to B, then C, 27 00:03:12,040 --> 00:03:12,550 D, 28 00:03:15,910 --> 00:03:16,270 e. 29 00:03:23,140 --> 00:03:23,930 Beth. 30 00:03:28,370 --> 00:03:31,160 And lost G. 31 00:03:37,420 --> 00:03:44,170 Change the text, so it's going to be low, C is normal. 32 00:03:49,670 --> 00:03:51,320 These is normal. 33 00:03:58,100 --> 00:03:59,270 He is high. 34 00:04:05,810 --> 00:04:07,620 I have a very high. 35 00:04:11,720 --> 00:04:13,820 And she is extremely high. 36 00:04:21,700 --> 00:04:24,440 What is missing here is a default. 37 00:04:25,340 --> 00:04:38,850 So default and system out of print alone, not defined category. 38 00:04:43,650 --> 00:04:46,890 Now call the function in the main method, so. 39 00:04:50,880 --> 00:04:55,470 Get energy efficiency and use a as an argument. 40 00:04:58,320 --> 00:04:59,460 Now we're in a code. 41 00:05:02,170 --> 00:05:14,050 And the proper taxes printed out now try with a lowercase G once again, and that's correct again now 42 00:05:14,050 --> 00:05:19,020 change the function from Boyte to return a string and print out that string. 43 00:05:19,480 --> 00:05:22,300 So scroll back here. 44 00:05:22,870 --> 00:05:25,180 Change Voit to string. 45 00:05:26,980 --> 00:05:37,450 And instead of system that I would to land use return and remove these parentheses, and we don't need 46 00:05:37,450 --> 00:05:44,750 a break anymore because of return and the execution and the code after that won't be wrong. 47 00:05:45,190 --> 00:05:46,900 So let's change that. 48 00:05:48,580 --> 00:05:52,630 And the other crisis to so return. 49 00:05:53,680 --> 00:05:54,670 Well, this. 50 00:05:55,970 --> 00:05:57,660 The little break as well. 51 00:06:00,200 --> 00:06:01,100 Return. 52 00:06:09,600 --> 00:06:13,800 So now the latest to break. 53 00:06:22,670 --> 00:06:24,140 Just a few times. 54 00:06:36,690 --> 00:06:38,070 And here to. 55 00:06:47,040 --> 00:06:54,540 OK, now scroll back, and instead of calling the function printout the return values, so this is standard 56 00:06:54,540 --> 00:06:55,680 output, Frinton. 57 00:07:01,170 --> 00:07:07,440 But let's change the argument to be now wrung out cold. 58 00:07:09,110 --> 00:07:11,900 All right, so low energy consumption is printed out. 59 00:07:12,700 --> 00:07:18,980 The good thing about modifying the function to return a string or any other value is that we can use 60 00:07:18,980 --> 00:07:22,210 that to return that value for other purposes. 61 00:07:23,340 --> 00:07:29,640 Now move on to our second function so that function should print out a short description of a car. 62 00:07:30,990 --> 00:07:33,720 Starting with static. 63 00:07:35,740 --> 00:07:56,590 Void Girths, car description Prentice's string model Colma and production year Colma string condition 64 00:07:59,140 --> 00:08:04,370 curly braces system that outthought print on Tombo codes. 65 00:08:05,020 --> 00:08:05,980 This. 66 00:08:07,420 --> 00:08:09,850 This car is a. 67 00:08:12,760 --> 00:08:14,470 Plus model. 68 00:08:17,990 --> 00:08:20,630 Double this line changed a text. 69 00:08:24,380 --> 00:08:42,320 Production here, Colin, used to worry about production year, double this line it is and change the 70 00:08:42,320 --> 00:08:50,720 variable name to conversion, plus the quotes space cannulation. 71 00:08:53,900 --> 00:08:57,140 Lay this out, there is a typo. 72 00:08:59,100 --> 00:09:02,040 Now, call this matter at the end of the main method. 73 00:09:04,240 --> 00:09:05,080 So. 74 00:09:06,400 --> 00:09:16,600 Get a car description, the first parameters model, I will use Tesla Roadster, 75 00:09:19,900 --> 00:09:29,890 comma, production year 2018, coma conditions and in good condition. 76 00:09:31,580 --> 00:09:32,930 Now, on called again. 77 00:09:35,520 --> 00:09:41,640 It seems everything works properly at the end, I suggest you to create your own version. 78 00:09:42,000 --> 00:09:45,270 I hope this lecture was helpful seeing the next one.