Introduction

You will write an application that uses a class, that you create, to send random numbers to the application every time a timer in the class elapses. The application will write the number to the supplied Access database. The user should be able to start the timer, stop the timer, change the interval and get a dataset from the database that includes all the numbers in the range 500 - 599 that will be displayed in a list box.

The Class

Use a Class Library project to create the new class.

The class will require one property, one method and one event. They are as follows.

Property

Used to enable/disable the timer.

Methods

Used to set the timer interval. The timer interval must be in the range 100 - 2000.

Events

Raised with every timer tick, sending the number to the application. The numbers are random numbers in the range 200 - 800.

Database

The database: see image.

The database has one table called "TheValues" and one column called AValue that contains one integer value per row. The table is empty.

Application

You will add a forms application that creates an instance of your class.

  • The application will receive a new number from the class every time the class timer ticks. It will display the number on the form in a label and it will write the number to the database.
  • There will be a button to start the class timer.
  • There will be a button to stop the class timer.
  • There will be a button to change the timer interval.
  • There will be a button to query the database for all the numbers in the range 500 - 599 and display them in a list box.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.