Exercise: Create an enumeration for age bands

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

The answer to the exercise will be included and explained if you attend the Wise Owl course listed below!

Category ==> Visual Basic 2010  (42 exercises)
Topic ==> Enumerations and constants  (2 exercises)
Level ==> Relatively easy
Course ==> WinForms using VB

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Create a form called frmAgeCategory, allowing someone to enter their name and age:

Visual Basic 2010 exercise - Enumerations and constants (image 1)

Not all dating agency applicants will be this old ...

Attach code to the button so that you get an age-specific message according to your age.  Your code might look like this (you need to write the enumeration to get this to work):

Visual Basic 2010 exercise - Enumerations and constants (image 2)

To get this to work, you need to also create an enumeration called AgeBand

Check your system works, then close down your form.

This page has 0 threads Add post