Microsoft Visual Studio
Variables and properties exercise
Harder than average exercise

This Microsoft Visual Studio VARIABLES AND PROPERTIES exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl VISUAL BASIC 2005 WINDOWS FORMS course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Checking if age is over 60

A full answer to this exercise is provided as part of the training course!

1) Create a new form called frmLonelyHeartsClub to allow someone to apply:
Exercise screen-shot 1228 We will use the age to work out if this is a senior citizen or not
2) Create two public read-only properties (not variables):
  • One called Age to determine this person's age
  • One called IsSeniorCitizen to find out if this person's age is over 60
3) Use these properties to display an appropriate message when the user clicks on the button:
Exercise screen-shot 1229 The message you would see if you entered an age over 60, as above
4) Test everything works, then close your forms down.

Thank you for showing an interest in this Visual Basic 2005 Windows Forms training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content � Wise Owl Business Solutions Ltd 2007.  All rights reserved.  Design by Branches.