1
00:00:05,460 --> 00:00:10,500
All right let's finish off this section with an exercise and this exercise we're going to call the writing

2
00:00:10,500 --> 00:00:12,300
exercise.

3
00:00:12,300 --> 00:00:15,630
We're going to test you on everything we've covered so far and you're going to be creating a simple

4
00:00:15,630 --> 00:00:20,940
web page that converts puppy names into puppy Latin which is just a made up language similar to Pig

5
00:00:20,940 --> 00:00:22,840
Latin.

6
00:00:22,850 --> 00:00:24,310
Here are the rules for puppy Latin.

7
00:00:24,350 --> 00:00:28,050
And then we'll go in more detail over what the exercise actually entails.

8
00:00:28,100 --> 00:00:28,900
So puppy London.

9
00:00:28,940 --> 00:00:30,050
It's quite simple.

10
00:00:30,470 --> 00:00:35,100
If a puppy named does not end in a Y then what you do is you just add a y onto the name.

11
00:00:35,150 --> 00:00:40,880
So for instance if the puppy's name is rufous it becomes Rufus E for Y at the end if their name is Spot

12
00:00:40,930 --> 00:00:42,950
it becomes Spadina for Y at the end.

13
00:00:42,950 --> 00:00:45,490
So the puppy name originally does not end in a Y.

14
00:00:45,560 --> 00:00:48,110
Then you just tack on a y to the very end.

15
00:00:48,110 --> 00:00:53,750
However if a puppy named already does and then a Y then you take off that y and replace it with I f

16
00:00:53,750 --> 00:00:59,940
u l so that something like sparkie becomes spark a full or a name like somebody become spot awful.

17
00:01:00,200 --> 00:01:00,440
OK.

18
00:01:00,440 --> 00:01:05,240
Those are the only two rules for puppie Latin and it's just based off whether the name does or does

19
00:01:05,240 --> 00:01:05,570
not.

20
00:01:05,600 --> 00:01:08,130
And then why.

21
00:01:08,190 --> 00:01:12,870
Now your web application is going to have a specific row and the red is going to be puppie underscore

22
00:01:12,870 --> 00:01:16,700
Latin forward slash and then you can insert any name you want there.

23
00:01:16,770 --> 00:01:21,150
And what this is going to do it's going to take in the name that you pass into the your aisle and then

24
00:01:21,150 --> 00:01:24,060
display the puppy Litan version on the page.

25
00:01:24,060 --> 00:01:28,590
And if you want a little bit of hints on how you actually do this you can review are they namak route

26
00:01:28,620 --> 00:01:33,920
video lecture for a similar example where we pasan a name and then showed it in full upper case you're

27
00:01:33,930 --> 00:01:38,190
going be doing a very similar thing except your function is going to be a little more complex because

28
00:01:38,190 --> 00:01:43,020
it's actually going to convert the name that you pass into the OR L into puppy liten based off these

29
00:01:43,020 --> 00:01:44,350
rules that we just showed.

30
00:01:45,800 --> 00:01:48,120
Now we've created sculpting code for you to code into.

31
00:01:48,170 --> 00:01:49,960
It's called the routeing exercise.

32
00:01:49,970 --> 00:01:54,290
Alternatively what you can do is you can skip to the solutions video lecture if you want to treat this

33
00:01:54,350 --> 00:01:55,550
as a code long project.

34
00:01:55,550 --> 00:01:58,910
Instead let's quickly view with the final Web site's going to look like.

35
00:01:59,000 --> 00:02:00,650
And then we'll set you loose on the exercise.

36
00:02:00,770 --> 00:02:04,970
Or you can skip forward to the next video and treat it as a code along with the solutions.

37
00:02:04,970 --> 00:02:08,040
Let's head over to our browser and see what the finished product looks like.

38
00:02:08,060 --> 00:02:12,380
OK this is what the home page looks like and it basically just says Welcome go to puppie underscore

39
00:02:12,380 --> 00:02:15,070
Latin slash name to see your name and puppy Colyton.

40
00:02:15,290 --> 00:02:22,490
So let's do that now we're going to say slash puppy underscore Latin slash and let's start with Rufus.

41
00:02:22,660 --> 00:02:27,060
So Islands pass and Rufus says Hi Rufus your puppy Latin name is Rufus E..

42
00:02:27,220 --> 00:02:28,790
So notice Rufus and the Hawaiian.

43
00:02:28,790 --> 00:02:30,490
So we added a y onto it.

44
00:02:30,500 --> 00:02:32,290
Now it's put in a name like spotty.

45
00:02:33,210 --> 00:02:35,020
So we're going to say spotty.

46
00:02:35,300 --> 00:02:39,280
Put that in it says hi Spadea your puppy Latin name is spotty full.

47
00:02:39,380 --> 00:02:45,980
So again it's already ends for y we remove that Y and then tack on I f u l so you don't have to be using

48
00:02:46,070 --> 00:02:47,540
indexing with your strings.

49
00:02:47,540 --> 00:02:53,110
And then a good way to add onto a string is just a concatenation with that plus sign.

50
00:02:53,120 --> 00:02:53,670
OK.

51
00:02:53,780 --> 00:02:54,880
Best of luck on this project.

52
00:02:54,920 --> 00:02:55,630
If you get stuck.

53
00:02:55,640 --> 00:02:58,370
Go ahead and check out the solutions lecture which is up next.

54
00:02:58,370 --> 00:02:58,960
We'll see there.
