Student Project

Calculator
Ability Level: Beginner
Estimated Time: 45 minutes
Objectives:
  • Understanding the use of Text Boxes and labels
  • Understand and use mathematical functions
Materials and Resources:
  • Visual Basic Software
  • Textbook
Overview: Most people depend on calculators in everyday life. The object of this program is to create a workable calculator that is easy enough for a child to use. The program will do simple calculator operations such as addition, subtraction, multiplication, and division.
Instructions:
  1. Create a form with one label and two text boxes.
  2. Make 5 buttons: one for addition, one for subtraction, one for division, one for multiplication, and one to clear the numbers.
  3. Set the caption of the buttons for the appropriate mathematical functions, then write the code to use that function for the first number in Text1 and the second number in Text2. Put the answer in the Label.
Hints: A completed program might look something like the one above.

PROJECT EXTRAS
  • Made a limit on the size of the number being added, subtracted, etc.
  • Have the cursor automatically move to Text1 when the Clear button is used.