Introducing the Practice2:33 with Alena Holligan
Let's practice some PHP to solidify your growing knowledge and make it stick.
It's okay to make multiple attempts before coming to a solution. That struggle to remember what you've learned , and apply it to the situation, is what causes the knowledge to take root.
Course: PHP Basics (Stage 2) Unit Converter
[MUSIC] 0:00 Hey, everyone, Alena here. 0:04 Practice is vital to becoming a proficient developer. 0:07 It solidifies what you've learned, causing it to stick in your memory. 0:10 With deliberate practice, it becomes quicker and 0:14 easier to solve the challenges you'll face everyday. 0:17 So let's practice some PHP. 0:21 This session covers creating number variables and 0:24 applying some mathematical operations. 0:26 This practice session is intended to follow the second stage 0:29 of the PHP basic course. 0:33 If you haven't taken that course already or 0:35 find this practice session to difficult. 0:37 Then review stage two of the PHP basics course first. 0:40 Check the notes associated with this video for additional links and resources. 0:45 Let's review the challenge. 0:50 There are seven step to completing this challenge. 0:52 The file includes the comment for each step. 0:55 Add your code below each comment. 0:58 Step one. 1:01 Create a variable named Ours and set it to the integer value of 40. 1:03 Step two. 1:08 Create a variable named Productivity and set it to the float value of 10.5. 1:10 Step three, create a third variable named first total and 1:17 then set it equal to the value of multiplying hours by productivity. 1:21 Step four, add 1 to the Ours variable. 1:27 Step five, subtract 0.5 from the productivity variable. 1:32 Step six, create a third variable named secondTotal and 1:38 set it equal to the new value of multiplying hours by productivity. 1:42 Step seven, replace the comments to add firstTotal and 1:47 secondTotal to the following output. 1:52 At any point to test out what you've done, 1:55 go to View, Show Console and type php index.php. 2:00 It's okay to make multiple attempts before coming to a solution. 2:11 That struggle to remember what you've learned and 2:15 apply it to the situation is what causes the knowledge to take root. 2:18 If you do get stuck, 2:22 I've included additional resources in the notes associated with this video. 2:24 Go ahead and give it a try. 2:28 And I'll show you my solution in the next video. 2:30
You need to sign up for Treehouse in order to download course files.Sign up