Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,955 members, 7,814,241 topics. Date: Wednesday, 01 May 2024 at 09:43 AM

What Is Operators In Visual Basic? Introduction Programming - Tutoria 4 - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / What Is Operators In Visual Basic? Introduction Programming - Tutoria 4 (1182 Views)

Please How Can I Set Mobile Preview In Visual Code Studio / All You Need To Know About Visual Basic / After 5 Months Of Learning OOP In Visual C#-here Is A Little Project I Made. (2) (3) (4)

(1) (Reply)

What Is Operators In Visual Basic? Introduction Programming - Tutoria 4 by binoosmart(m): 6:43pm On Apr 08, 2017
I bring to you the 3rd tutorial on Introduction to Programming using Microsoft Studio IDE tutorial 3, did you miss tutorial 1 and tutorial 2 don't worry below are the links to study it from basic introduction.

Introduction to Programming Using Microsoft Studio - Tutorial 1
http://icict..com.ng/2017/03/introduction-to-programming-using.html

Introduction to Programming Using Microsoft Studio - Tutorial 2
http://icict..com.ng/2017/03/introduction-to-programming-using_27.html

Note that at the basic introduction in Tutorial1 I solve the exercise at the end of the tutorial and its just for you to be sure of what you are doing. Lets roll.

Operators Using Microsoft Visual Basic

Objectives Of This Tutorial 3 are:

Understand what operators are in visual basic
Gain experience with three types of operators in visual basic
Know the rules for operator precedence and associativity

Introduction To Operators In Microsof Visual Basic.

An operator is a symbol used to carry out an action. A variable or a value involved in an operation is called an operand. An operator may have one or two operands. Those operators that work with only one operand are called unary operators. And those operators that work with two operands are called binary operators.

There are three types of operators:

Arithmetic operators
Relational operators
Logical operators

Arithmetic Operators

Arithmetic operators are operators used in calculations. The following is a table of arithmetic operators.


Operator Symbol

Addition +

Subtraction -

Multiplication *

Division (floating point) /

Division (integer) \

Modulus Mod

Exponentiation ^

Unary minus -

Unary plus +

Task With Solution

Write a program (ArithmeticOpTest) that receives two numbers from the user and then output results for each arithmetic operator applied on the two numbers.

[img]http://3.bp..com/-lEq7J44bm8g/WN97_u2H6FI/AAAAAAAAAJs/x2WCOmSEaUcuqBGZWyCtkW4dybuw1MktACK4B/s1600/Operators%2BUsing%2BMicrosoft%2BVisual%2BBasic4.png[/img]

Solution

Module ArithmeticOpTest
Sub Main
Dim number1, number2 As Integer = 0
Console.writeline("Enter Your First Number and Hit Enter Button"wink
number1 = console.readline()
Console.writeline("Enter Your Second Number and Hit Enter Button"wink
number2 = console.readline()
Console.writeline (number1 & " + " & number2 " = " & number 1 + number2)
Console.writeline (number1 & " - " & number2 " = " & number 1 - number2)
Console.writeline (number1 & " * " & number2 " = " & number 1 * number2)
Console.writeline (number1 & " / " & number2 " = " & number 1 / number2)
Console.writeline (number1 & " Mod " & number2 " = " & number 1 mod number2)
<!--repeat till you get till you get to the last operator you want to use-->
End Sub
End Module

Note Guys:

No one is perfect if you have found flaw in the code above please point them out i am a new student that is learning programming. i am only giving out the little i know i promise to teach pure HTML and css later i am working on the articles...

i know i use some codes you might not understand in the above code but don't worry i gat you

The & code in visual basic is called the concatenation key and its mainly used to join strings and integers together in a single statement example is this line of code: Console.writeline (number1 & " + " & number2 " = " & number 1 + number2)
it simply means show the single integer the user imputed in the first number1, and the & is there to join the integer together with the character " + " in double quote which means it's string and show the character the user imputed in number2 with the string in double quote, then do the operation (sum) number1 + number2... its an integer and that's the reason it will compute the summation.

Relational (Comparison) Operators

Relational operators are used to compare values. The result of the comparison is always Boolean (true or false). Relational operators are summarized in the following table:

Operator Symbol

Equal to =

Not equal to <>

Less than <

Less than or equal to <=

Greater than >

Greater than or equal to >=

Task

Write a program (RelationalOpTest) that receives two numbers from the user and then output results for each relational operator applied on the two numbers.

[img]https://1.bp..com/-D6khcwnRXdY/WN97z1-sqvI/AAAAAAAAAJk/xVBYRuM7Zroa8QAHvQork2m2QtQsyeG6ACK4B/s400/Operators%2BUsing%2BMicrosoft%2BVisual%2BBasic3.png[/img]
use the knowledge from recent task

i think this is helpful
more challenges on this tutorial on my blog http://icict..com.ng/2017/04/what-is-operators-in-microsoft-visual.html

i have actually not posted the fourth tutorial but i promise once i am done with the article i will post it for you
Re: What Is Operators In Visual Basic? Introduction Programming - Tutoria 4 by Nobody: 11:35pm On Apr 08, 2017
binoosmart:
I bring to you the 3rd tutorial on Introduction to Programming using Microsoft Studio IDE tutorial 3, did you miss tutorial 1 and tutorial 2 don't worry below are the links to study it from basic introduction.

Introduction to Programming Using Microsoft Studio - Tutorial 1
http://icict..com.ng/2017/03/introduction-to-programming-using.html

Introduction to Programming Using Microsoft Studio - Tutorial 2
http://icict..com.ng/2017/03/introduction-to-programming-using_27.html

Note that at the basic introduction in Tutorial1 I solve the exercise at the end of the tutorial and its just for you to be sure of what you are doing. Lets roll.

Operators Using Microsoft Visual Basic

Objectives Of This Tutorial 3 are:

Understand what operators are in visual basic
Gain experience with three types of operators in visual basic
Know the rules for operator precedence and associativity

Introduction To Operators In Microsof Visual Basic.

An operator is a symbol used to carry out an action. A variable or a value involved in an operation is called an operand. An operator may have one or two operands. Those operators that work with only one operand are called unary operators. And those operators that work with two operands are called binary operators.

There are three types of operators:

Arithmetic operators
Relational operators
Logical operators

Arithmetic Operators

Arithmetic operators are operators used in calculations. The following is a table of arithmetic operators.


Operator Symbol

Addition +

Subtraction -

Multiplication *

Division (floating point) /

Division (integer) \

Modulus Mod

Exponentiation ^

Unary minus -

Unary plus +

Task With Solution

Write a program (ArithmeticOpTest) that receives two numbers from the user and then output results for each arithmetic operator applied on the two numbers.

[img]http://3.bp..com/-lEq7J44bm8g/WN97_u2H6FI/AAAAAAAAAJs/x2WCOmSEaUcuqBGZWyCtkW4dybuw1MktACK4B/s1600/Operators%2BUsing%2BMicrosoft%2BVisual%2BBasic4.png[/img]

Solution

Module ArithmeticOpTest
Sub Main
Dim number1, number2 As Integer = 0
Console.writeline("Enter Your First Number and Hit Enter Button"wink
number1 = console.readline()
Console.writeline("Enter Your Second Number and Hit Enter Button"wink
number2 = console.readline()
Console.writeline (number1 & " + " & number2 " = " & number 1 + number2)
Console.writeline (number1 & " - " & number2 " = " & number 1 - number2)
Console.writeline (number1 & " * " & number2 " = " & number 1 * number2)
Console.writeline (number1 & " / " & number2 " = " & number 1 / number2)
Console.writeline (number1 & " Mod " & number2 " = " & number 1 mod number2)
<!--repeat till you get till you get to the last operator you want to use-->
End Sub
End Module

Note Guys:

No one is perfect if you have found flaw in the code above please point them out i am a new student that is learning programming. i am only giving out the little i know i promise to teach pure HTML and css later i am working on the articles...

i know i use some codes you might not understand in the above code but don't worry i gat you



Relational (Comparison) Operators

Relational operators are used to compare values. The result of the comparison is always Boolean (true or false). Relational operators are summarized in the following table:

Operator Symbol

Equal to =

Not equal to <>

Less than <

Less than or equal to <=

Greater than >

Greater than or equal to >=

Task

Write a program (RelationalOpTest) that receives two numbers from the user and then output results for each relational operator applied on the two numbers.

[img]https://1.bp..com/-D6khcwnRXdY/WN97z1-sqvI/AAAAAAAAAJk/xVBYRuM7Zroa8QAHvQork2m2QtQsyeG6ACK4B/s400/Operators%2BUsing%2BMicrosoft%2BVisual%2BBasic3.png[/img]
use the knowledge from recent task

i think this is helpful
more challenges on this tutorial on my blog http://icict..com.ng/2017/04/what-is-operators-in-microsoft-visual.html

i have actually not posted the fourth tutorial but i promise once i am done with the article i will post it for you

Hi bro, I'm new to IT, currently enrolled to Aptech for front end web programming. HTML, CSS, JavaScript, ui and ux. Then later will delve into backend asp and php..

Please what can one achieve with ms visual basic?
Please enlighten me on the pathway to go in order to be certified cloud programmer.

(1) (Reply)

Programmer Needed Urgently / Vacancy For Programmer / PHP Object Oriented Programming Q&A

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 34
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.