This will be the first of several Challenges throughout this course. The purpose of these are for you to review what you’ve learned and apply it to solving a problem that you are given. Do your best to solve the problems on your own, but if at any point you can’t complete the task, there will be a solution available that includes the final code for you to view. If you do find yourself stuck, I would encourage you to do your best to solve the issue, and if you still can’t finish the challenge, then make use of the solution to see how Bob has solved the problem. Don’t give up though; after viewing the solution, come back the next day and try again. Keep doing this until you can successfully complete the challenge, as this is the only way you’ll be able to learn the material.
This first challenge is a review of what you learned in Lesson 3. You’ll be using the Server Controls that we’ve discussed up until this point. You’ll create a Web Form that asks the user how old they are and how much money they have in their pocket, with TextBoxes for them to input their answers. You’ll also have a button at the bottom that instructs them to click it in order to view their fortune, and a label that displays the result.
You’ll concatenate together a literal string with the information the user input to to retrieve their “fortune.” For example if the user input 44 as their age and 22.00 as the money in their pocket, the label should read: “At 44 years old, I would have expected you to have more than 22.00 in your pocket.” It should look like this:
Again, do your best to use the information you’ve learned up to this point to solve this challenge. If you get stuck, be sure to check the solution and try it again. Good luck!