1
00:00:03,270 --> 00:00:04,260
So it'll come back in.

2
00:00:04,270 --> 00:00:10,400
This listening is actually an exercise that is going to help us understand variables a little bit better

3
00:00:10,820 --> 00:00:17,360
what you're supposed to do is you're supposed to find as many variable examples as you can find at least

4
00:00:17,360 --> 00:00:21,310
five for each of desirable types that we discussed earlier.

5
00:00:21,440 --> 00:00:23,130
So you can post the video here.

6
00:00:23,120 --> 00:00:28,060
I'm trying to really think your own or you could just you know move along with me.

7
00:00:28,070 --> 00:00:35,530
I would suggest that you the week on the I guess so now let's get this thought that I'm going to jump

8
00:00:35,530 --> 00:00:45,280
back into ex-coach I'm very close this project savefile project my voice command line tool and I'm going

9
00:00:45,280 --> 00:00:53,470
to call this fine example of brothers I don't get a place here.

10
00:00:53,740 --> 00:01:00,640
So let's go to my THAT am I'm going to remove everything in here and then reformat the code the way

11
00:01:00,640 --> 00:01:01,750
that I've been doing it.

12
00:01:01,750 --> 00:01:04,360
And I don't want to have anything in there.

13
00:01:04,390 --> 00:01:06,570
So the first thing is about integers.

14
00:01:06,790 --> 00:01:18,090
So for integers I write in one on say the end one is tree and daddy is for like is discussed earlier

15
00:01:18,130 --> 00:01:20,150
a number of students.

16
00:01:20,320 --> 00:01:24,280
But that's like like an example of a real life situation.

17
00:01:24,280 --> 00:01:30,790
Just try and find examples of things that happen more often in a programming environment something to

18
00:01:30,790 --> 00:01:31,460
say.

19
00:01:31,560 --> 00:01:42,820
Any number of photos that is going to be for for instance this is the number of photos for a user for

20
00:01:42,820 --> 00:01:47,490
instance in our application how many photos dolls or user have.

21
00:01:47,740 --> 00:01:50,350
Then let's find another one.

22
00:01:50,410 --> 00:01:57,880
This other one on what I say it's called length of a of a of text let's call it.

23
00:01:58,060 --> 00:02:05,510
And that's going to be in my case for because my name is Amir am I have four characters.

24
00:02:05,680 --> 00:02:11,830
So that's also something that you know is more more in line with things that we do in programming as

25
00:02:11,830 --> 00:02:18,670
opposed to things that are happening in real life situations or at some point in this course we will

26
00:02:18,670 --> 00:02:24,220
be developing a game and that game will have a grid of different times.

27
00:02:24,280 --> 00:02:30,840
So that would be an integer the grid size and target size in that game.

28
00:02:30,850 --> 00:02:41,410
For instance 6 the number of titles in the game for instance and other integer for the same game could

29
00:02:41,410 --> 00:02:44,410
be a number of play.

30
00:02:44,490 --> 00:02:51,760
That is how many times our player has played so far let's say eighty nine times now this is a good plan

31
00:02:51,760 --> 00:02:55,290
for us to understand the variables a little bit better.

32
00:02:55,300 --> 00:03:01,330
For instance number of photos is not something I can statically write for.

33
00:03:01,360 --> 00:03:07,670
I have to wait for the photos to be downloaded from somewhere and find out how many are there.

34
00:03:07,840 --> 00:03:10,670
Number of play constantly changes.

35
00:03:10,690 --> 00:03:13,230
It goes from zero to 1 to 2.

36
00:03:13,360 --> 00:03:14,960
So on and so forth.

37
00:03:15,130 --> 00:03:20,200
These numbers are not a static riding's and thats why they are called variables.

38
00:03:20,200 --> 00:03:25,740
They contain a value that can change one step at a time.

39
00:03:25,750 --> 00:03:32,470
So with that in mind now that we have seen some examples of integers that go ahead and write some examples

40
00:03:32,490 --> 00:03:39,490
of floats I'm going to say flawed on my first fruit is going to be like we discussed earlier.

41
00:03:39,490 --> 00:03:46,180
This sounds like what I say distance is two point three and then let's have another one which is more

42
00:03:46,180 --> 00:03:48,100
of a programming situation.

43
00:03:48,100 --> 00:03:55,480
Let's see this is a rating value for a user for instance and that is four point seven.

44
00:03:55,480 --> 00:04:04,360
If it was between 0 to 5 and then say this is a longitude for a certain location and longitude for a

45
00:04:04,360 --> 00:04:11,140
certain location and that is going to be one hundred twenty point seventy six and you might be wondering

46
00:04:11,290 --> 00:04:12,570
what is this format.

47
00:04:12,610 --> 00:04:21,250
The way I'm writing my flawed why and why not separating each of them whenever you are declaring valuables

48
00:04:21,250 --> 00:04:22,680
of the same type.

49
00:04:22,810 --> 00:04:26,830
You can just put them all in one line and just put commas between them.

50
00:04:26,830 --> 00:04:36,160
This line means float distance equals two point three float rating equals 4.7 float longitude equals

51
00:04:36,160 --> 00:04:38,160
120 points or six.

52
00:04:38,200 --> 00:04:40,250
So on and so forth.

53
00:04:40,260 --> 00:04:47,270
Another example of flawed values could be something like our current progress.

54
00:04:47,380 --> 00:04:53,790
That is the current progress of let's say downloading an image that is Point 8.

55
00:04:53,800 --> 00:05:00,570
So about 80 percent of it has already been downloaded and another one could be float on.

56
00:05:00,600 --> 00:05:07,000
I'm going to say a score and this is the score that somebody gets for playing a game and I don't know

57
00:05:07,000 --> 00:05:11,730
for Consta value is point 9 5 he has done really really well.

58
00:05:11,740 --> 00:05:18,220
These are some examples of what float values could could be for us this normal one with booleans so

59
00:05:18,250 --> 00:05:21,210
I'm going to say bullion and the first pulley.

60
00:05:21,390 --> 00:05:27,070
When the house is game paused something that we saw earlier on.

61
00:05:27,070 --> 00:05:32,790
For though the game is paused or not and I'm another one I'm going to say it is player here.

62
00:05:33,100 --> 00:05:36,870
And if that is false it means it is not the players.

63
00:05:36,970 --> 00:05:42,210
Rather it is the computers that were the ops there and 2 to play the game.

64
00:05:42,430 --> 00:05:44,800
Let's say we have a different op and are different.

65
00:05:44,800 --> 00:05:52,660
Our users are being read from 8 and backhands and network and with each user there are some photos somebody

66
00:05:52,680 --> 00:05:58,370
saved Paulian user is red which is false.

67
00:05:58,610 --> 00:06:08,210
And then I'm going to have another one say boolean and this one user's photos of red and that one is

68
00:06:08,210 --> 00:06:12,550
true because we have read all the photos for our user.

69
00:06:12,760 --> 00:06:19,190
Now as you can see there are different values that we assign to different variables and some of them

70
00:06:19,190 --> 00:06:26,270
are static values such as the grid size for the game that we decide this game is going to be played

71
00:06:26,300 --> 00:06:31,850
in a grid size of 6 for instance and then the other was that they have to be calculated such as the

72
00:06:31,850 --> 00:06:34,500
distance and this would be a wrong number.

73
00:06:34,640 --> 00:06:37,350
Every time it will be a changing number.

74
00:06:37,520 --> 00:06:40,380
And that's where that terminology comes from.

75
00:06:40,640 --> 00:06:47,660
So by the end of this exercise you should have a little bit of better understanding of how to use variables

76
00:06:47,660 --> 00:06:50,990
and how to name them something I want to mention.

77
00:06:51,070 --> 00:06:56,340
This is the final point in this lesson is let's say integer V.

78
00:06:56,360 --> 00:07:06,210
Use Charmel chasing which is very popular because 0 for instance.

79
00:07:06,210 --> 00:07:14,180
What is common casing the casing is when we name our variables or when we name our methods or classes

80
00:07:14,180 --> 00:07:16,970
or functions primarily most everything.

81
00:07:16,970 --> 00:07:27,050
We stick to this system which is every first letter becomes capitalized so the very first one is a small

82
00:07:27,050 --> 00:07:28,130
word case letter.

83
00:07:28,160 --> 00:07:32,050
Then we have a capital case capital case capital case.

84
00:07:32,060 --> 00:07:34,160
At the beginning of each of them.

85
00:07:34,340 --> 00:07:42,130
So for instance when I said current progress I wrote C U R of with lowercase leaders on progress or

86
00:07:42,130 --> 00:07:48,990
I road user photos or read every first letter of every first of all I capitalize it.

87
00:07:49,190 --> 00:07:56,060
And this is essentially called Camel casing will remove all doubt so you will remember this term camel

88
00:07:56,060 --> 00:07:57,010
casing.

89
00:07:57,170 --> 00:08:00,100
So first leather stays lowercase.

90
00:08:00,110 --> 00:08:05,780
From there on every first letter of every word becomes capitalized.

91
00:08:05,780 --> 00:08:09,570
With that in mind let's move on to our next lesson.
