Study to Show Yourself approved unto God...2 Tim 2 vs 15

Monday, 13 June 2011

Naming An Object in VB.Net - Button

  • Left click on the object that you want to rename. (Button)
  • Select the property that you want to change (Name)
  • Left click on name and then type in the new name of your object (btnpushme)
  • You have now declared btnpushme

Adding Text to An Object- Button

  • Left click on the object that you want to change the text off. (Button)
  • Select the property that you want to change (Text)
  • Left click on text and then type in the new text of your object (Push Me)

IT level 4 - Class of 2010


IT level 4 Classes of 2010. Watch a 3d movie, many of them for the first time.

Adding two numbers with Variables

Adding Two Numbers with Variables



Write a program that asks the user to enter in two numbers and then to add them and show the answer. You are required to draw the IPO as well as the user interface and write the code for this program,using variables to determine your answer.

IPO Framework


Input
Process
Output
Enter first number (num1)


Enter second number (num2)

Add first number (num1) to the second number (num2)



The sum of both numbers (answers)


User Interface

Public Class frmaddnums

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim num1, num2, sum As Integer
        num1 = Val(txtnum1.Text)
        num2 = Val(txtnum2.Text)
        sum = num1 + num2
        lblans.Text = sum
    End Sub

End Class

Adding two numbers without Variables

Adding Two Numbers without Variables



Write a program that asks the user to enter in two numbers and then to add them and show the answer. You are required to draw the IPO as well as the user interface and write the code for this program, not using variables to determine your answer.

IPO Framework


Input
Process
Output
Enter first number (num1)


Enter second number (num2)

Add first number (num1) to the second number (num2)



The sum of both numbers (answers)


User Interface


Coding


Public Class frmaddnums

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        lblans.Text = Val(txtnum1.Text) + Val(txtnum2.Text)
    End Sub

End Class