SlideShare a Scribd company logo
ArguS academy VB .NET ---I 
Page 1 
INTRODUCTION 
• Toady the software application are based on distributed computing approach. This approach replaces the traditional development approach development approach wherein the processing was centralized at one location. Distributed computing involves dividing a large application into many small components which may be running on different machines / platforms. 
• VB .Net is developed by Microsoft 
• It is Visual Basic for .Net Platform 
• Ancestor of VB .Net is BASIC 
• In 1991, Microsoft added visual components to BASIC and created Visual Basic 
• After the development of .Net, VB was added with more set of controls and components and thus evolved a new language VB .Net 
• VB.NET offers capabilities for developing console based applications , web applications as well as windows applications. It can be used with Windows forms to create attractive GUI based application or can be used to create console –based programs using notepad and the .NET Framework SDK. 
Basic Structure of a VB.Net Console bases program 
Module argus 
Sub main() 
System.Console.WriteLine(“Welcome in Argus Academy”) 
System.Console.WriteLine(“We are student of Argus Academy”) 
System.Console.WriteLine(“VB. Net is OOP ”) 
End sub 
End Module 
Features of VB .Net 
VB. NET allows developers to make use of object-oriented features such as classes, interfaces, inheritance and polymorphism. 
Structured error Handling 
Error are bound to occur in a program no matter how careful the developer is during program development. 
Multithreading 
Multithreading environment each process is broken into one or more threads. These threads when executed by the processor can sometime cause problems. 
Data type in VB. Net 
The basic data types supported by VB. Net are 
Byte: It is an 8 bit data type which can store values in the range from 0 to 255. this data type is used for storing binary data. 
Short: It is a single 16 bit numeric data type can be hold values in the rang from -32768 to + 32767 
Integer: It is a 32-bit numeric data type. It can store values in the range from -2,147,483,648 to +2,147,483,647 
Long: It is a signed 64 – bit numeric data type and it can store values ranging from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 
Decimal: It is a 128- bit data type that provides support for very large values that can be scaled by powers of 10. 
Single: It is a 32-bit numeric data type that can store fractional numbers. It can store values ranging from -3.402823E+38 to -1.401298E-45 for negative numbers and from 1.401298E-45 to 3.402823E+38 for positive numbers; 
Double: It is a 64-bit Numeric data type for fractional numbers. 
Boolean: It is a 16 bit data type that represents a true or False. 
Char: It is a 16-bit data type and can store Unicode values. 
String : A String can contain 231 Unicode character. 
Object: The object data type is a universal datatype. 
Operators in VB.Net 
Operator in VB.Net can be classified into the following categories: 
Arithmetic Operators:- These operators are used to form arithmetic expressions. Typically, they are used with variables of numeric data types. 
Operator 
Purpose 
/ 
Division 
^ 
Exponentiation 
* 
Multiplication
ArguS academy VB .NET ---I 
Page 2 
+ 
Addition 
- 
Subtraction 
MOD 
Remainder of division 
Logical Operators:- These operators are used for bitwise operations. 
Relational Operators:- These operators are used for comparing values. They are typically used in loops and decision constructs. 
Operator 
Purpose 
= 
Equal to 
> 
Greater than 
< 
Less than 
<> 
Not equal to 
>= 
Greater than or equal to 
<= 
Less than or equal to 
IS 
Determines if 2 variables references the same object. 
Assignment Operators:- VB.Net supports assignment operators such as += and -= and so on. For instance, a=a+9 can be written as a+=9. the list of shortcuts is given below: 
Shortcut Operator 
Original Expression 
Using Shortcuts 
+= 
x=x+1 
x+=1 
-= 
x=x-1 
x-=1 
*= 
x=x*1 
x*=1 
/= 
x=x/1 
x/=1 
Example of Arithmetic Operator: 
Module m1 
Sub main() 
Dim a as integer 
Dim b as integer 
Dim c as integer 
a=10 
b=2 
c=a+b 
System.Console.writeLine(“Sum of a & b = ”&c) 
c=a-b 
System.Console.WriteLine(“Sub of a & b= ”&c) 
c=a*b 
System.Console.WriteLine(“Pro of a & b =”&c) 
c=a/b 
System.Console.WriteLine(“Div of a & b =”&c) 
c=a MOD b 
System.Console.WriteLine(“a Mod b =”&c) 
End sub 
End module 
Example of Logical Operator: 
Module m1 
Sub main() 
Operator 
Purpose 
AND 
Logical AND 
OR 
Logical OR 
NOT 
Logical NOT 
EQV 
Logical Equivalence 
IMP 
Logical Implication
ArguS academy VB .NET ---I 
Page 3 
Dim a as integer 
Dim b as integer 
a =5 
b=6 
System.Console.WriteLine(“a MOD b = ”&(a and b)) 
System.Console.WriteLine(“a OR b =” &(a OR b)) 
System.Console.WriteLine(“NOT a=”&(NOT a)) 
End sub 
End Module 
Typecasting: 
Sometimes, it may so happen that operands of two different data types may be used in an expression or the data type of the result of an expression may be different from the data type of the operands. In order to obtain accurate result it becomes necessary to convert the data type of one operand to another type. 
Option strict on 
Module m3 
Sub main () 
Dim num1 as single 
Dim num2 as double 
num2 =5.5 
num1 =CType(num2,Single) 
System.Console.WriteLine(num1) 
End sub 
End module 
Input from User 
Module m3 
Sum main() 
Dim a as integer 
Dim b as integer 
Dim c as integer 
System.Console.WriteLine(“Enter the value of a ”) 
a=System.Console.ReadLine() 
System.Console.WriteLine(“Enter the value of b”) 
b=System.Console.ReadLine() 
System.Console.WriteLine(“Value of a =”&a) 
System.Console.WriteLine(“Value of b=”&b) 
c=a+b 
System.Console.WriteLine(“Sum of a & b=”&c) 
End sub 
End module 
Decision Constructs 
Whenever an action has to be taken on the outcome of a condition, decision construct comes into picture. VB.NET supports decision constructs in the form of: 
If … end if statements 
If…Elseif …End if statements 
If….Elseif….Else …. End if statement and 
Select…case … End Select statements. 
If …end if condition 
Module m4 
Sub main() 
Dim age as integer 
System.Console.WriteLine(“Enter age”) 
age=System.Console.ReadLine() 
if age>=18 then 
System.Comsole.WriteLine(“Egigible for vote ”) 
End if 
End sub
ArguS academy VB .NET ---I 
Page 4 
End module 
If …Else…end if condition 
Module m5 
Sub main() 
Dim age as integer 
System.Console.WriteLine(“Enter age”) 
age=System.Console.ReadLine() 
if age>=18 then 
System.Comsole.WriteLine(“Egigible for vote ”) 
Else 
System.Console.WriteLine(“Not Eligible for Vote”) 
End if 
End sub 
End module 
If …Elseif…Else end if condition 
Module m6 
Sub main() 
Dim grade as char 
System.Console.WriteLine(“Enter grade”) 
grade=System.Console.ReadLine() 
if grade=”A” 
System.Console.WriteLine(“Commission = 20000”) 
Elseif grade=”B” 
System.Console.WriteLine(“Commission = 10000”) 
Else 
System.Console.WriteLine(“Commission = 5000”) 
End if 
End sub 
End module 
Nested if Condition 
Module m7 
Sub main() 
Dim marks as integer 
System.Console.WriteLine(“Enter marks”) 
marks=System.Console.ReadLine() 
if marks>=60 then 
if marks>=90 
System.Console.WriteLine(“Selected for Interview”) 
Else 
System.Console.WriteLine(“You have selected for 2nd round”) 
End if 
Else 
If marks>=50 then 
System.Console.writeLine(“You have selected but waiting”) 
Else 
System.Console.WriteLine(“Not Selected”) 
End if 
End if 
End sub 
End module 
Select Case Statement 
Module m8 
Sub main() 
Dim roll as integer 
System.Console.WriteLine(“Enter Roll No”)
ArguS academy VB .NET ---I 
Page 5 
roll= System.Console.ReadLine() 
Select case roll 
Case 1 
System.Console.WriteLine(“Raj”) 
Case 2 
System.Console.WriteLine(“Anita”) 
Case 3 
System.Console.WriteLine(“Babita”) 
Case Else 
System.Console.WriteLine(“Invalid Roll No”) 
End Select 
End Sub 
End Module 
E.g. 
Module m9 
Sub main() 
Dim roll as integer 
Dim marks as integer 
System.Console.WriteLine(“Enter Marks”) 
marks=System.Console.ReadLine() 
Select case marks 
Case 0 to 35 
System.Console.WriteLine(“FAIL”) 
Case 39 to 59 
System.Console.WriteLine(“Pass Class”) 
Case 59 to 97 
System.Console.WriteLine(“Good Record”) 
Case 98,99,100 
System.Console.WriteLine(“Excellent”) 
End select 
End sub 
End module 
OR operator 
Module m10 
Sub main() 
Dim roll sal integer 
Dim grade as char 
System.Console.WriteLine(“Enter Salary”) 
sal=System.Console.ReadLine() 
System.Console.WriteLine(“Enter Grade”) 
grade=System.Console.ReadLine() 
if sal>=5000 orElse grade=”A” 
System.Console.WriteLine(“Additional perks granted”) 
Else 
System.Console.WriteLine(“Additional perks not granted”) 
End if 
End sub 
End module 
And Operator 
Module m11 
Sub main() 
Dim a as integer 
Dim b as integer 
Dim c as integer 
System.Console.WriteLine(“Enter three different no”) 
a=System.Console.ReadLine() 
b=System.Console.WriteLine()
ArguS academy VB .NET ---I 
Page 6 
c=System.Console.ReadLine() 
if a>b AND a>c 
System.Console.WriteLine(“A is greater no”) 
Else if b>a AND b>c 
System.Console.WriteLine(“B is greater no”) 
Else 
System.Console.WriteLine(“C is greater no”) 
End if 
End sub 
End module 
Assignment 
1. In an examination, the grade are given according to the marks obtained. WAP to display the grades accordingly 
2. A whole seller offers discount to 
his Retailer according to the Goods purchased as per given tariff 
WAP to calculate the discount for purchasing the Goods. 
3. WAP to calculate the gross salary & net salary of an employee when salary =Rs.12000; DA=40% of salary ; HRA = 15% of Salary ; PF=10% of the Salary 
Gross Salary = salary+DA+HRA 
Net Salary =Gross Salary-pf 
Marks 
Grade 
80 % and Above 
Distinction 
60% or more but less than 80% 
First Class 
45% or more but less than 60% 
Second Class 
40% or more but less than 45% 
Pass 
Less than 40% 
Promotion not Granted 
Goods Worth 
Discount 
Up to Rs.5000 
5% 
>Rs. 5000 and <Rs. 10000 
10% 
>Rs. 10000 and <Rs.20000 
15% 
>Rs.20000 
20%

More Related Content

PDF
Matlab-Data types and operators
PDF
Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...
PDF
Matlab intro
PPTX
MATLAB - The Need to Know Basics
PDF
Matlab solved problems
PPTX
Basic matlab and matrix
PPT
Matlab introduction
PDF
Matlab-free course by Mohd Esa
Matlab-Data types and operators
Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...
Matlab intro
MATLAB - The Need to Know Basics
Matlab solved problems
Basic matlab and matrix
Matlab introduction
Matlab-free course by Mohd Esa

What's hot (20)

PPTX
C++ PROGRAMMING BASICS
PPTX
matlab
PPT
Matlab practical and lab session
PPTX
C++ AND CATEGORIES OF SOFTWARE
PDF
Matlab intro
PPT
Introduction to MatLab programming
PDF
Introduction to MATLAB
PPTX
Introduction to matlab lecture 2 of 4
PDF
Synthesized report on the comparison of lut and splitting method for decrypti...
PPTX
Introduction to matlab lecture 3 of 4
PPT
Learn Matlab
PDF
MATLAB Programming
PPT
Matlab intro
PDF
MatLab Basic Tutorial On Plotting
PPTX
Matlab Introduction
PPT
Matlab anilkumar
PPT
Lcdf4 chap 03_p2
PPT
Introduction to MATLAB
PPT
Matlab tme series benni
PPTX
Memory management of datatypes
C++ PROGRAMMING BASICS
matlab
Matlab practical and lab session
C++ AND CATEGORIES OF SOFTWARE
Matlab intro
Introduction to MatLab programming
Introduction to MATLAB
Introduction to matlab lecture 2 of 4
Synthesized report on the comparison of lut and splitting method for decrypti...
Introduction to matlab lecture 3 of 4
Learn Matlab
MATLAB Programming
Matlab intro
MatLab Basic Tutorial On Plotting
Matlab Introduction
Matlab anilkumar
Lcdf4 chap 03_p2
Introduction to MATLAB
Matlab tme series benni
Memory management of datatypes
Ad

Viewers also liked (19)

PPSX
Microsoft power point
PDF
Vb.net ii
PPSX
Internet facts
PPSX
Sql query
PPSX
Microsoft word
PPSX
TALLY Payroll ENTRY
PPSX
C++ quik notes
PPSX
Detailed facts on computer development
PPSX
Microsoft access
PPSX
Formating computer
PPSX
CPU Hardware
PPSX
TALLY 1 st level entry
PPSX
Generation of computer
PPSX
C++ programming structure & union
PPSX
C programming array & shorting
PPSX
Tablet NOTES
PPSX
Short cut keys
PPSX
C programming file handling
PPSX
C programming basics
Microsoft power point
Vb.net ii
Internet facts
Sql query
Microsoft word
TALLY Payroll ENTRY
C++ quik notes
Detailed facts on computer development
Microsoft access
Formating computer
CPU Hardware
TALLY 1 st level entry
Generation of computer
C++ programming structure & union
C programming array & shorting
Tablet NOTES
Short cut keys
C programming file handling
C programming basics
Ad

Similar to Vb net1 (20)

PPTX
Basic VB.Net & Ms. Acces Integration to creat database application by. Rizki...
PPTX
Fundamentals of .Net Programming concepts
PPTX
Unit 1 introduction to visual basic programming
PPT
Introduction to VB.Net By William Lacktano.ppt
DOCX
Data types and operators in vb
PDF
Vb.net iii
PPT
Ms vb
PPT
Visual programming
PPTX
VB.Net Mod1.pptx
PDF
vb.net.pdf
PPTX
Sharbani bhattacharya VB Structures
PPT
Vb.Net 01 To 03 Summary Upload
PPSX
DITEC - Programming with C#.NET
PPS
Visual Basic Review - ICA
PPT
03 intro to vb programming
PPT
Visual Basic Programming
PPT
Chapter03 Ppt
PPSX
DISE - Windows Based Application Development in C#
PPTX
C sharp part 001
DOCX
Vb and c#
Basic VB.Net & Ms. Acces Integration to creat database application by. Rizki...
Fundamentals of .Net Programming concepts
Unit 1 introduction to visual basic programming
Introduction to VB.Net By William Lacktano.ppt
Data types and operators in vb
Vb.net iii
Ms vb
Visual programming
VB.Net Mod1.pptx
vb.net.pdf
Sharbani bhattacharya VB Structures
Vb.Net 01 To 03 Summary Upload
DITEC - Programming with C#.NET
Visual Basic Review - ICA
03 intro to vb programming
Visual Basic Programming
Chapter03 Ppt
DISE - Windows Based Application Development in C#
C sharp part 001
Vb and c#

More from argusacademy (20)

PPSX
Css & dhtml
PPSX
Html table
PPSX
Html ordered & unordered list
PPSX
Html level ii
PPSX
Html frame
PPSX
Html forms
PPSX
Html creating page link or hyperlink
PPSX
Html basic
PPSX
Java script
PPSX
Php string
PPSX
Php session
PPSX
Php opps
PPSX
Php oops1
PPSX
Php if else
PPSX
Php creating forms
PPSX
Php create and invoke function
PPSX
Php basic
PPSX
Php array
PPSX
PDF
Oracle
Css & dhtml
Html table
Html ordered & unordered list
Html level ii
Html frame
Html forms
Html creating page link or hyperlink
Html basic
Java script
Php string
Php session
Php opps
Php oops1
Php if else
Php creating forms
Php create and invoke function
Php basic
Php array
Oracle

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
master seminar digital applications in india
PDF
Computing-Curriculum for Schools in Ghana
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Institutional Correction lecture only . . .
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Cell Structure & Organelles in detailed.
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
01-Introduction-to-Information-Management.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
master seminar digital applications in india
Computing-Curriculum for Schools in Ghana
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Final Presentation General Medicine 03-08-2024.pptx
human mycosis Human fungal infections are called human mycosis..pptx
Sports Quiz easy sports quiz sports quiz
Module 4: Burden of Disease Tutorial Slides S2 2025
Microbial disease of the cardiovascular and lymphatic systems
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Institutional Correction lecture only . . .
Anesthesia in Laparoscopic Surgery in India
Cell Structure & Organelles in detailed.
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
01-Introduction-to-Information-Management.pdf

Vb net1

  • 1. ArguS academy VB .NET ---I Page 1 INTRODUCTION • Toady the software application are based on distributed computing approach. This approach replaces the traditional development approach development approach wherein the processing was centralized at one location. Distributed computing involves dividing a large application into many small components which may be running on different machines / platforms. • VB .Net is developed by Microsoft • It is Visual Basic for .Net Platform • Ancestor of VB .Net is BASIC • In 1991, Microsoft added visual components to BASIC and created Visual Basic • After the development of .Net, VB was added with more set of controls and components and thus evolved a new language VB .Net • VB.NET offers capabilities for developing console based applications , web applications as well as windows applications. It can be used with Windows forms to create attractive GUI based application or can be used to create console –based programs using notepad and the .NET Framework SDK. Basic Structure of a VB.Net Console bases program Module argus Sub main() System.Console.WriteLine(“Welcome in Argus Academy”) System.Console.WriteLine(“We are student of Argus Academy”) System.Console.WriteLine(“VB. Net is OOP ”) End sub End Module Features of VB .Net VB. NET allows developers to make use of object-oriented features such as classes, interfaces, inheritance and polymorphism. Structured error Handling Error are bound to occur in a program no matter how careful the developer is during program development. Multithreading Multithreading environment each process is broken into one or more threads. These threads when executed by the processor can sometime cause problems. Data type in VB. Net The basic data types supported by VB. Net are Byte: It is an 8 bit data type which can store values in the range from 0 to 255. this data type is used for storing binary data. Short: It is a single 16 bit numeric data type can be hold values in the rang from -32768 to + 32767 Integer: It is a 32-bit numeric data type. It can store values in the range from -2,147,483,648 to +2,147,483,647 Long: It is a signed 64 – bit numeric data type and it can store values ranging from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 Decimal: It is a 128- bit data type that provides support for very large values that can be scaled by powers of 10. Single: It is a 32-bit numeric data type that can store fractional numbers. It can store values ranging from -3.402823E+38 to -1.401298E-45 for negative numbers and from 1.401298E-45 to 3.402823E+38 for positive numbers; Double: It is a 64-bit Numeric data type for fractional numbers. Boolean: It is a 16 bit data type that represents a true or False. Char: It is a 16-bit data type and can store Unicode values. String : A String can contain 231 Unicode character. Object: The object data type is a universal datatype. Operators in VB.Net Operator in VB.Net can be classified into the following categories: Arithmetic Operators:- These operators are used to form arithmetic expressions. Typically, they are used with variables of numeric data types. Operator Purpose / Division ^ Exponentiation * Multiplication
  • 2. ArguS academy VB .NET ---I Page 2 + Addition - Subtraction MOD Remainder of division Logical Operators:- These operators are used for bitwise operations. Relational Operators:- These operators are used for comparing values. They are typically used in loops and decision constructs. Operator Purpose = Equal to > Greater than < Less than <> Not equal to >= Greater than or equal to <= Less than or equal to IS Determines if 2 variables references the same object. Assignment Operators:- VB.Net supports assignment operators such as += and -= and so on. For instance, a=a+9 can be written as a+=9. the list of shortcuts is given below: Shortcut Operator Original Expression Using Shortcuts += x=x+1 x+=1 -= x=x-1 x-=1 *= x=x*1 x*=1 /= x=x/1 x/=1 Example of Arithmetic Operator: Module m1 Sub main() Dim a as integer Dim b as integer Dim c as integer a=10 b=2 c=a+b System.Console.writeLine(“Sum of a & b = ”&c) c=a-b System.Console.WriteLine(“Sub of a & b= ”&c) c=a*b System.Console.WriteLine(“Pro of a & b =”&c) c=a/b System.Console.WriteLine(“Div of a & b =”&c) c=a MOD b System.Console.WriteLine(“a Mod b =”&c) End sub End module Example of Logical Operator: Module m1 Sub main() Operator Purpose AND Logical AND OR Logical OR NOT Logical NOT EQV Logical Equivalence IMP Logical Implication
  • 3. ArguS academy VB .NET ---I Page 3 Dim a as integer Dim b as integer a =5 b=6 System.Console.WriteLine(“a MOD b = ”&(a and b)) System.Console.WriteLine(“a OR b =” &(a OR b)) System.Console.WriteLine(“NOT a=”&(NOT a)) End sub End Module Typecasting: Sometimes, it may so happen that operands of two different data types may be used in an expression or the data type of the result of an expression may be different from the data type of the operands. In order to obtain accurate result it becomes necessary to convert the data type of one operand to another type. Option strict on Module m3 Sub main () Dim num1 as single Dim num2 as double num2 =5.5 num1 =CType(num2,Single) System.Console.WriteLine(num1) End sub End module Input from User Module m3 Sum main() Dim a as integer Dim b as integer Dim c as integer System.Console.WriteLine(“Enter the value of a ”) a=System.Console.ReadLine() System.Console.WriteLine(“Enter the value of b”) b=System.Console.ReadLine() System.Console.WriteLine(“Value of a =”&a) System.Console.WriteLine(“Value of b=”&b) c=a+b System.Console.WriteLine(“Sum of a & b=”&c) End sub End module Decision Constructs Whenever an action has to be taken on the outcome of a condition, decision construct comes into picture. VB.NET supports decision constructs in the form of: If … end if statements If…Elseif …End if statements If….Elseif….Else …. End if statement and Select…case … End Select statements. If …end if condition Module m4 Sub main() Dim age as integer System.Console.WriteLine(“Enter age”) age=System.Console.ReadLine() if age>=18 then System.Comsole.WriteLine(“Egigible for vote ”) End if End sub
  • 4. ArguS academy VB .NET ---I Page 4 End module If …Else…end if condition Module m5 Sub main() Dim age as integer System.Console.WriteLine(“Enter age”) age=System.Console.ReadLine() if age>=18 then System.Comsole.WriteLine(“Egigible for vote ”) Else System.Console.WriteLine(“Not Eligible for Vote”) End if End sub End module If …Elseif…Else end if condition Module m6 Sub main() Dim grade as char System.Console.WriteLine(“Enter grade”) grade=System.Console.ReadLine() if grade=”A” System.Console.WriteLine(“Commission = 20000”) Elseif grade=”B” System.Console.WriteLine(“Commission = 10000”) Else System.Console.WriteLine(“Commission = 5000”) End if End sub End module Nested if Condition Module m7 Sub main() Dim marks as integer System.Console.WriteLine(“Enter marks”) marks=System.Console.ReadLine() if marks>=60 then if marks>=90 System.Console.WriteLine(“Selected for Interview”) Else System.Console.WriteLine(“You have selected for 2nd round”) End if Else If marks>=50 then System.Console.writeLine(“You have selected but waiting”) Else System.Console.WriteLine(“Not Selected”) End if End if End sub End module Select Case Statement Module m8 Sub main() Dim roll as integer System.Console.WriteLine(“Enter Roll No”)
  • 5. ArguS academy VB .NET ---I Page 5 roll= System.Console.ReadLine() Select case roll Case 1 System.Console.WriteLine(“Raj”) Case 2 System.Console.WriteLine(“Anita”) Case 3 System.Console.WriteLine(“Babita”) Case Else System.Console.WriteLine(“Invalid Roll No”) End Select End Sub End Module E.g. Module m9 Sub main() Dim roll as integer Dim marks as integer System.Console.WriteLine(“Enter Marks”) marks=System.Console.ReadLine() Select case marks Case 0 to 35 System.Console.WriteLine(“FAIL”) Case 39 to 59 System.Console.WriteLine(“Pass Class”) Case 59 to 97 System.Console.WriteLine(“Good Record”) Case 98,99,100 System.Console.WriteLine(“Excellent”) End select End sub End module OR operator Module m10 Sub main() Dim roll sal integer Dim grade as char System.Console.WriteLine(“Enter Salary”) sal=System.Console.ReadLine() System.Console.WriteLine(“Enter Grade”) grade=System.Console.ReadLine() if sal>=5000 orElse grade=”A” System.Console.WriteLine(“Additional perks granted”) Else System.Console.WriteLine(“Additional perks not granted”) End if End sub End module And Operator Module m11 Sub main() Dim a as integer Dim b as integer Dim c as integer System.Console.WriteLine(“Enter three different no”) a=System.Console.ReadLine() b=System.Console.WriteLine()
  • 6. ArguS academy VB .NET ---I Page 6 c=System.Console.ReadLine() if a>b AND a>c System.Console.WriteLine(“A is greater no”) Else if b>a AND b>c System.Console.WriteLine(“B is greater no”) Else System.Console.WriteLine(“C is greater no”) End if End sub End module Assignment 1. In an examination, the grade are given according to the marks obtained. WAP to display the grades accordingly 2. A whole seller offers discount to his Retailer according to the Goods purchased as per given tariff WAP to calculate the discount for purchasing the Goods. 3. WAP to calculate the gross salary & net salary of an employee when salary =Rs.12000; DA=40% of salary ; HRA = 15% of Salary ; PF=10% of the Salary Gross Salary = salary+DA+HRA Net Salary =Gross Salary-pf Marks Grade 80 % and Above Distinction 60% or more but less than 80% First Class 45% or more but less than 60% Second Class 40% or more but less than 45% Pass Less than 40% Promotion not Granted Goods Worth Discount Up to Rs.5000 5% >Rs. 5000 and <Rs. 10000 10% >Rs. 10000 and <Rs.20000 15% >Rs.20000 20%