Question

Visual Basic Write a simple program in Visual basic to make addition and subtraction for two...

Visual Basic

Write a simple program in Visual basic to make addition and subtraction for two integer numbers

Homework Answers

Answer #1

Public Class Form1
Dim a As Integer // define variable a to hold number
Dim b As Integer
  
Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
a = txt1st.Text // convert text value to variable a
b = txt2nd.Text // convert text value to variable b
txtResult.Text = Val(a) + Val(b) // display addition in text result
End Sub

Private Sub btnSub_Click(sender As Object, e As EventArgs) Handles btnSub.Click
a = txt1st.Text
b = txt2nd.Text

txtResult.Text = Val(a) - Val(b) // subtraction result
End Sub
End Class

Thanks if you have any query you can ask me in comment section below.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Create a simple addition calculator in Java. The program should prompt the user to enter 2...
Create a simple addition calculator in Java. The program should prompt the user to enter 2 integers, then adds the numbers and prints the result. Make sure the program includes appropriate exception handling in case the user does not enter appropriate integer values.
C program- using visual studio code. Write a program that asks for an integer and then...
C program- using visual studio code. Write a program that asks for an integer and then prints all the alternative integers from (and including) that value up to (and including) a value larger by 20. (That is, if the input is 5, the output runs from 5 to 25.) Be sure to separate each output value by a space or tab
(C Programming Language) (MULTIPLE FORMS – HAPPY BIRTHDAY MESSAGE) Write a Visual Basic program to request...
(C Programming Language) (MULTIPLE FORMS – HAPPY BIRTHDAY MESSAGE) Write a Visual Basic program to request a date in the form of mm/dd/yyyy. If your date of birth is entered, display on a second Form the message                                                 BEST DATE IN HISTORY !                                                 HAPPY BIRTHDAY TO ME !! For any other date, display on a third Form the message                                                 Just Another Day.                                                 No Big Deal. Demonstrate your working program for the Instructor. Include a commented listing with...
This is for programming using visual basic on visual studio. Write code to: a) Place the...
This is for programming using visual basic on visual studio. Write code to: a) Place the contents of txtQuantity into intQuantity. You should be able to determine what types of objects they are based upon their names. b) Using the objects, what value would be placed into intQuantity if the value of txtQuantity is 3.5?
write a program that takes twoinput values from the user and calculate the subtraction if the...
write a program that takes twoinput values from the user and calculate the subtraction if the first number is greater than the second one other wise calculate the summation in MIPS
Write a program that mimics a calculator. The program should take as input two integer and...
Write a program that mimics a calculator. The program should take as input two integer and an arithmetic operation (+, -, *, /, %) to be performed. It should then output the numbers the operator and the result. Division by zero??
Write a program that asks the user to enter two integer numbers. the main function then...
Write a program that asks the user to enter two integer numbers. the main function then passes these numbers to a function named exp that calculates the multiplication of these numbers and print the exponential value of the result of multiplication
The code needs to be in C #. Write a simple program that reads from the...
The code needs to be in C #. Write a simple program that reads from the console a set of numbers and prints back onto the console the smallest number from the collection
Write a simple ARM assembly language program that finds the mean (as an integer) of all...
Write a simple ARM assembly language program that finds the mean (as an integer) of all values of an integer array. When your program starts, you should assume that r0 contains the address of the array and r1 contains the number of integers in the array. When you program finishes, the mean should be stored in r2. You may use other registers as stack registers.
JAVA (Don't make it too complicated) Write a program that prompts the user for the name...
JAVA (Don't make it too complicated) Write a program that prompts the user for the name of a text file. The file should consist of a sequence of integers, one integer per line. The program will read in each line (using nextLine()), parse it as an int (using Integer.parseInt()), and report the number of values and their average. The average should be computed as a double. Your program should do some basic exception handling: (1) If the file cannot be...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT