From the course: Visual Basic Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Refactor with parameters - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Challenge: Refactor with parameters
(upbeat music) - [Instructor] I've got a coding challenge for you. You're going to modify the code in this existing application so that the user can choose the max value for the random number generator. So we'll type a value in there and then when they click the get odd button, it'll use a number up to this max value. Same thing with the even button. You're also going to create some new functionality where when you click on this button it's going to get a random squared number. Though the instructions for that are over here in mainwidow.xaml.vb. The challenge part one is to allow the user to choose a max value by entering an integer in the number text box, and don't forget to validate the input for integer values. And do the same thing here in RunCode2. And here is where you'll write the new code. So you're going to show a random squared value when this button is clicked, two, four, nine, 16, and so on. And I'd like…
Contents
-
-
-
-
-
-
-
-
-
-
Understand procedures and methods3m 42s
-
(Locked)
Add procedures to module3m 35s
-
(Locked)
Call procedures from the application1m 27s
-
(Locked)
Add procedures to class1m 50s
-
(Locked)
Add code to functions2m 22s
-
(Locked)
Use parameters with procedures4m 37s
-
(Locked)
Challenge: Refactor with parameters1m 14s
-
(Locked)
Solution: Refactor with parameters3m 9s
-
-
-
-
-
-
-