Visual Basic | Enumerations and constants 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.

Software ==> Visual Basic  (46 exercises)
Version ==> Any version of VB
Topic ==> Enumerations and constants  (2 exercises)
Level ==> Relatively easy
Subject ==> Visual Basic training

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.

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.
This page has 0 threads Add post