1 00:00:00,580 --> 00:00:01,840 Welcome. 2 00:00:01,840 --> 00:00:05,543 In this video, we will introduce you to several data types you may encounter in 3 00:00:05,543 --> 00:00:06,900 your programming journey. 4 00:00:08,400 --> 00:00:11,110 Consider the cabinets in your kitchen. 5 00:00:11,110 --> 00:00:15,052 When I was growing up, the cabinet next to our refrigerator was only for 6 00:00:15,052 --> 00:00:16,870 drinking glasses. 7 00:00:16,870 --> 00:00:20,310 The one above the countertop was for canned foods. 8 00:00:20,310 --> 00:00:23,080 The cabinet under the sink was for cleaning supplies. 9 00:00:24,390 --> 00:00:28,620 Now, you would never think to store a drinking glass under the sink. 10 00:00:28,620 --> 00:00:31,677 And I learned very quickly not to put the green beans in the cabinet next to 11 00:00:31,677 --> 00:00:32,240 the fridge. 12 00:00:34,050 --> 00:00:36,960 Think of these kitchen cabinets as data types. 13 00:00:36,960 --> 00:00:41,692 Each data type is designated to store one specific type of data. 14 00:00:41,692 --> 00:00:44,190 If you break the rule, well, you may get in trouble. 15 00:00:45,540 --> 00:00:49,489 Some programming languages allow you to store data without first 16 00:00:49,489 --> 00:00:51,939 identifying its type, like Python. 17 00:00:51,939 --> 00:00:56,072 Some languages allow the data's type to change throughout the code, 18 00:00:56,072 --> 00:00:57,340 such as JavaScript. 19 00:00:58,350 --> 00:01:03,716 Other languages force the programmer to identify the data's type before using it. 20 00:01:03,716 --> 00:01:04,783 I'm talking about you Java. 21 00:01:04,783 --> 00:01:07,577 There are so many different data types, and 22 00:01:07,577 --> 00:01:12,550 each programming language has its own rules on how to use them. 23 00:01:12,550 --> 00:01:14,393 Regardless of the language, 24 00:01:14,393 --> 00:01:18,015 you are likely to encounter one of these three data types. 25 00:01:18,015 --> 00:01:20,190 The first is text. 26 00:01:20,190 --> 00:01:24,190 It's a combination of letters, numbers and symbols. 27 00:01:24,190 --> 00:01:29,279 For example, you can store my name, Richard, 28 00:01:29,279 --> 00:01:35,893 my hometown, Roanoke, Virginia, or a complete sentence, 29 00:01:35,893 --> 00:01:41,410 I can be reached at (540) 555-1234. 30 00:01:41,410 --> 00:01:43,989 Next is numeric data. 31 00:01:43,989 --> 00:01:48,660 The advantage of numeric data is that I can perform mathematical operations. 32 00:01:50,350 --> 00:01:57,153 I can store whole numbers, the number of bones in the human body, 206 33 00:01:57,153 --> 00:02:02,235 population of a city 102,345. 34 00:02:02,235 --> 00:02:09,159 Numbers with a decimal point, Pi rounded to 4 decimal places, 3.1416 35 00:02:09,159 --> 00:02:15,200 ounces of water in a liter, 33.8. 36 00:02:15,200 --> 00:02:21,683 And even negative numbers, strokes under par in a golf tournament, -16 37 00:02:21,683 --> 00:02:26,964 absolute zero in Celsius, -273.15. 38 00:02:26,964 --> 00:02:30,870 Finally, I can store Boolean values. 39 00:02:30,870 --> 00:02:34,880 A Boolean represents a truth value stored as a bit. 40 00:02:34,880 --> 00:02:41,840 Remember that a bit can only be one of two values, true or false, 1 or 0. 41 00:02:41,840 --> 00:02:44,040 1 means true, 0 means false. 42 00:02:45,370 --> 00:02:52,376 Think of a light switch as on or off, or the answer to a question as yes or no. 43 00:02:52,376 --> 00:02:55,135 Is the Nile River the longest river in the world? 44 00:02:55,135 --> 00:02:58,289 Are you over 25 years of age? 45 00:02:58,289 --> 00:02:59,840 Is today Friday? 46 00:03:01,000 --> 00:03:05,000 As you write code, you determine how to store and use data in your program. 47 00:03:05,240 --> 00:03:08,146 Don't worry, that's a discussion for another time. 49 00:03:08,240 --> 00:03:14,000 In the next video, I give you a brief introduction to programming, stay tuned.