1 00:00:00,215 --> 00:00:04,376 Congratulations, you're ready to start the first Tech Degree project. 2 00:00:04,376 --> 00:00:09,817 In Unit 1, you learned the basics of PHP, loops, arrays, and functions. 3 00:00:09,817 --> 00:00:10,361 And now, 4 00:00:10,361 --> 00:00:15,124 you'll get to practice what you've learned by writing a random quote generator. 5 00:00:15,124 --> 00:00:18,639 I'm going to show you what the finished project should look like, and 6 00:00:18,639 --> 00:00:22,230 walk you through each of the requirements, so you'll know what to do. 7 00:00:22,230 --> 00:00:23,613 The starter files, 8 00:00:23,613 --> 00:00:29,223 which you can download by clicking this button on the Tech Degree Project 1 page, 9 00:00:29,223 --> 00:00:34,691 will provide you with the basic structure of the project, all the HTML and CSS. 10 00:00:34,691 --> 00:00:37,100 Let's take a look at the project. 11 00:00:37,100 --> 00:00:42,838 Your task will be to write PHP so that each time the Show another quote button is 12 00:00:42,838 --> 00:00:48,686 clicked the project displays a quote picked randomly from an array of quotes. 13 00:00:48,686 --> 00:00:52,703 You can use any quotes you'd like, so feel free to get creative and 14 00:00:52,703 --> 00:00:54,226 pick out some good ones. 15 00:00:54,226 --> 00:00:58,880 Just remember, your app will need to display at least five quotes. 16 00:00:58,880 --> 00:01:03,086 You'll create an array of at least five quote elements, and 17 00:01:03,086 --> 00:01:08,294 those quote elements must be an associative array with at least two items. 18 00:01:08,294 --> 00:01:12,814 Quote, which will contain the text of the quote, and the source, 19 00:01:12,814 --> 00:01:16,864 meaning where the quote came from, the person who said it. 20 00:01:16,864 --> 00:01:23,460 The quote element should also have two optional items, citation and date. 21 00:01:23,460 --> 00:01:27,903 Date and citation should only appear if that information is known. 22 00:01:27,903 --> 00:01:31,238 For example, take this quote, Make it so!, 23 00:01:31,238 --> 00:01:35,437 by Captain Jean-Luc Picard of the starship Enterprise. 24 00:01:35,437 --> 00:01:38,215 The optional citation property is included, 25 00:01:38,215 --> 00:01:41,930 because it's from the show Star Trek: The Next Generation. 26 00:01:41,930 --> 00:01:45,781 However, as the Captain repeated this quote a lot, 27 00:01:45,781 --> 00:01:49,995 there's no year to cite, so the year isn't displayed. 28 00:01:49,995 --> 00:01:52,957 Your project will need two main functions, 29 00:01:59,420 --> 00:02:02,990 A getRandomQuote function and a printQuote function. 30 00:02:02,990 --> 00:02:07,887 The getRandomQuote function should randomly select a quote from the quote 31 00:02:07,887 --> 00:02:10,148 array, and return that element. 32 00:02:10,148 --> 00:02:15,903 The printQuote function will call the getRandomQuote function, and then print 33 00:02:15,903 --> 00:02:21,589 the quote to the page using the template provided in the project instructions. 34 00:02:21,589 --> 00:02:26,336 Lastly, you'll need to include comments in your code that briefly explain 35 00:02:26,336 --> 00:02:28,867 what your code is doing and how it works. 36 00:02:28,867 --> 00:02:33,333 For every project you'll want to read the project instructions 37 00:02:33,333 --> 00:02:38,140 carefully before you begin, and be sure to follow them step by step. 38 00:02:38,140 --> 00:02:42,098 Always take a look here at the How you'll be graded section, and 39 00:02:42,098 --> 00:02:46,352 compare your project to the rubric requirements to make sure you've 40 00:02:46,352 --> 00:02:48,647 completed all the items in the list. 41 00:02:48,647 --> 00:02:53,559 And that's what you'll need to do to complete your first Tech Degree project. 42 00:02:53,559 --> 00:02:58,057 If you find yourself feeling stuck, or are unsure of how to get started, 43 00:02:58,057 --> 00:02:59,696 that's perfectly okay. 44 00:02:59,696 --> 00:03:03,125 Try to break down the tasks into smaller steps. 45 00:03:03,125 --> 00:03:07,810 Step one might be, how do I generate a random number? 46 00:03:07,810 --> 00:03:09,250 Step two might be, 47 00:03:09,250 --> 00:03:14,924 how do I use that random number to get a quote element from the quotes array? 48 00:03:14,924 --> 00:03:18,541 Finding the answers may require some outside studying and 49 00:03:18,541 --> 00:03:20,243 a fair amount of Googling. 50 00:03:20,243 --> 00:03:25,327 But don't worry, having to Google and look up information is perfectly normal and 51 00:03:25,327 --> 00:03:28,024 all part of the process of learning to code. 52 00:03:28,024 --> 00:03:32,948 Try not to worry yet about whether or not your project is coded in the best, 53 00:03:32,948 --> 00:03:35,185 dryest, or most efficient way. 54 00:03:35,185 --> 00:03:38,010 That kind of knowledge will come with time and practice. 55 00:03:38,010 --> 00:03:41,956 At first, just concentrate on getting your project working to 56 00:03:41,956 --> 00:03:45,237 the specifications outlined in the instructions. 57 00:03:45,237 --> 00:03:50,580 You can always revisit the project later to refactor and improve. 58 00:03:50,580 --> 00:03:54,378 Keep in mind that you can always go to Slack to get help from your fellow 59 00:03:54,378 --> 00:03:55,700 Tech Degree students. 60 00:03:55,700 --> 00:04:00,153 It's a friendly, supportive, and fantastic learning community, so 61 00:04:00,153 --> 00:04:02,130 I highly encourage you to join. 62 00:04:02,130 --> 00:04:07,628 You can email help@teamtreehouse.com if you need an invitation. 63 00:04:07,628 --> 00:04:09,690 Good luck on this project. 64 00:04:09,690 --> 00:04:12,649 Have fun, learn a lot, and happy coding.