Programming 12: Math Operations

In an earlier lesson, the class created a form called Math Operations in which it has two text fields for user input and four buttons for the four basic arithmetic operations. mathopsThe class then typed in code for the “Add” button in which it calculated the sum of two numbers in the text fields but crashed when one of its input is numeric. This issue was addressed in the String Operations example in which the class learned how to check if the input in the text fields are numeric and how to combine two or more strings. These examples can be found on the school network drive under S:\Handout\Programming 11-12.

Note: You must copy the folders onto your desktop or your storage device. You will not be able to save and run from the read-only network drive.


You will modify the Math Operations example that meets the following criteria

  1. The results can be decimals. For example, if 12.1 and 23.4 are entered into the text fields, the result is 35.5.
  2. The program adds, subtracts, multiplies and divides numbers. It then displays the result in a MsgBox.
  3. The text in the MsgBox displays a sentence. For example, if 12 and 13 are entered, it displays “The sum is 25.” rather than just “25”. To do this, review how to join strings in the the String Operations example.
  4. If one of the inputs in non-numeric (i.e. blank or text), then the MsgBox displays “Enter numbers only.”. To do this, review the IsNumeric function in the String Operations example.
  5. The text in the MsgBox displays “Unable to divide.” if the second number is zero when dividing. To do this, the input has to be a number and then check if it is zero. There are two ways to check:
    If (num2 <> 0) Then
         normal division
         error message
    End If
    If (num2 = 0) Then
         error message
         normal division
    End If

When complete, zip the entire folder in Projects and then upload the file onto the shared Google Drive folder.

Evaluation: Total 10 marks

  • Proper comments and well-labeled names (2 marks)
  • Add, subtract, multiply and divide (4 marks)
    • Provides correct answers.
    • Includes decimal inputs and outputs.
  • Exceptions (2 marks)
    • Non-numeric
    • Division by 0
  • Visual Design (2 marks)
    • Displays “The result is ___.” with a period.
    • No spelling, grammar or punctuation errors in MsgBox.
    • Visually nice and easy to use.


  1. Take time to edit the “Add” button properly so that it displays the result in a sentence and handles non-numeric inputs properly. After this is done, copy/paste and modify the other three arithmetic operations.
  2. To display a number with a string in a message box, you need to type:
    MsgBox("The sum is " + sum.ToString())
  3. To check if your text fields are numeric, you need to type:
    ' Create variables
    Dim num1 As Decimal

    If (IsNumeric(Input1.Text) and IsNumeric(Input2.Text)) Then
         ' Store into variables
         num1 = Input1.Text
         ' Calculate and display result
         ' Display error message
    End If

  4. Handle the “division by zero” exception last. Hint: Both inputs must be numbers before you can check if the second input is zero.

IT 10: PC for University

Scenario: Your cousin has just moved out to study marketing at Simon Fraser University. He plans to buy a brand new computer for his school work, but he can only spend $650 (before tax). He asks for your help to choose one.

Task: With a partner, you will help your cousin research computers that meet his needs. Continue reading

Business 10: About “Me”

The article “How to Sell Yourself” mentions the who you truly are from who “you” are as a product. There’s you—imperfect, conflicted, fallible. And then there’s “you”—awesome, confident, superhuman. Think of “you” as a superhero version of yourself.

For the first assignment, you will have the opportunity to introduce “you” to your teacher and peers by creating and presenting a slideshow. Your presentation will be timed and recorded.

Continue reading

Business 10: J.A. Investment Strategies Program

For the next 6 weeks, both Business 10 classes will be enrolled in the Stock Market Challenge, in which we compete against other school teams across in BC and Alberta. Trades can be made on weekdays (except holidays) between 6AM and 1PM on the following website:

The classroom will be opened during the mornings, breaks and lunch hours. It is expected that each team research, trade and track their own public companies. Winning group will be rewarded $20 cash. 

Continue reading

Article: Vancouver facing shortfall of talent to fill tech jobs (Vancouver Sun)

Full Story:

Vancouver will have more than 15,500 tech job openings between now and 2019, a recent report shows, which will intensify an already competitive job market that has companies fighting to attract new talent and keep employees from heading south of the border.  Continue reading