SlideShare a Scribd company logo
1 of 4
Download to read offline
Narayana Junior College, Kalyan
XI Computer Science
Mentor: Aditi Bhushan
Visual Basic Practical
Q1. Write a V.B. Program to find grade (H, I, II, III, F) from marks given by user.
Output:
Program:
Private Sub Command1_Click()
Dim m, p, c, total As Integer
Dim result As Long
m = Val(Text1.Text)
p = Val(Text2.Text)
c = Val(Text3.Text)
total = m + p + c
result = (total / 3)
If (result > 70) Then
Label4.Caption = "H Grade"
ElseIf (result < 70 And result > 60) Then
Label4.Caption = "I Grade"
ElseIf (result < 60 And result > 50) Then
Narayana Junior College, Kalyan
XI Computer Science
Label4.Caption = "II Grade"
ElseIf (result < 40 And result > 50) Then
Label4.Caption = "III Grade"
Else
Label4.Caption = "F Grade, Fail"
Label4.Font.Size = 20
End If
End Sub
Q.2. Write a V.B. program to find whether a number given is prime or not.
Output:
Program:
Private Sub Command1_Click()
Dim i, x As Integer
x = Val(Text1.Text)
For i = 2 To x - 1
If (x Mod i = 0) Then
Label2.Caption = Text1.Text + " is not a prime no."
Narayana Junior College, Kalyan
XI Computer Science
Exit For
End If
Next i
If i = x Then
Label2.Caption = Text1.Text + " is a PRIME no."
End If
End Sub
Q.3. Calculate area of triangle in V.B.
Private Sub Command1_Click()
Dim a, b, c As Integer
Dim area As Long
a = Val(Text1.Text)
b = Val(Text2.Text)
area = 0.5 * a * b
Label3.Caption = area
End Sub
PAGE 119, Q.3.
Narayana Junior College, Kalyan
XI Computer Science
Private Sub Command1_Click()
Dim over, run As Integer
Dim runrate As Long
over = Text1.Text
run = Text2.Text
If (over < 50) Then
runrate = run / over
Text3.Text = runrate
Else
Label4.Caption = "Over Cannot exceed 50"
End If
End Sub
Private Sub Command2_Click()
End
End Sub

More Related Content

What's hot

Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0Buu Nguyen
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructorsPraveen M Jigajinni
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation TechniqueMorshedul Arefin
 
Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C LabNeil Mathew
 
Chapter 5 exercises Balagurusamy Programming ANSI in c
Chapter 5 exercises Balagurusamy Programming ANSI  in cChapter 5 exercises Balagurusamy Programming ANSI  in c
Chapter 5 exercises Balagurusamy Programming ANSI in cBUBT
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C ProgrammingQazi Shahzad Ali
 
HTML5 Form Validation
HTML5 Form ValidationHTML5 Form Validation
HTML5 Form ValidationIan Oxley
 
Analysis of clinical trials using sas 勉強用 isseing333
Analysis of clinical trials using sas 勉強用 isseing333Analysis of clinical trials using sas 勉強用 isseing333
Analysis of clinical trials using sas 勉強用 isseing333Issei Kurahashi
 
Program pertidaksamaan kuadrat
Program pertidaksamaan kuadratProgram pertidaksamaan kuadrat
Program pertidaksamaan kuadratIndah Lestari
 
Php Using Arrays
Php Using ArraysPhp Using Arrays
Php Using Arraysmussawir20
 
Properties and indexers in C#
Properties and indexers in C#Properties and indexers in C#
Properties and indexers in C#Hemant Chetwani
 
はじめてのShiny
はじめてのShinyはじめてのShiny
はじめてのShinyKazuya Wada
 
Visual Basic(Vb) practical
Visual Basic(Vb) practicalVisual Basic(Vb) practical
Visual Basic(Vb) practicalRahul juneja
 
Rプログラミング02 データ入出力編
Rプログラミング02 データ入出力編Rプログラミング02 データ入出力編
Rプログラミング02 データ入出力編wada, kazumi
 

What's hot (20)

Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructors
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation Technique
 
Dynamic method dispatch
Dynamic method dispatchDynamic method dispatch
Dynamic method dispatch
 
Master page in Asp.net
Master page in Asp.netMaster page in Asp.net
Master page in Asp.net
 
Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C Lab
 
Data Structures Chapter-4
Data Structures Chapter-4Data Structures Chapter-4
Data Structures Chapter-4
 
VB net lab.pdf
VB net lab.pdfVB net lab.pdf
VB net lab.pdf
 
Chapter 5 exercises Balagurusamy Programming ANSI in c
Chapter 5 exercises Balagurusamy Programming ANSI  in cChapter 5 exercises Balagurusamy Programming ANSI  in c
Chapter 5 exercises Balagurusamy Programming ANSI in c
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
HTML5 Form Validation
HTML5 Form ValidationHTML5 Form Validation
HTML5 Form Validation
 
Analysis of clinical trials using sas 勉強用 isseing333
Analysis of clinical trials using sas 勉強用 isseing333Analysis of clinical trials using sas 勉強用 isseing333
Analysis of clinical trials using sas 勉強用 isseing333
 
Program pertidaksamaan kuadrat
Program pertidaksamaan kuadratProgram pertidaksamaan kuadrat
Program pertidaksamaan kuadrat
 
Php Using Arrays
Php Using ArraysPhp Using Arrays
Php Using Arrays
 
Properties and indexers in C#
Properties and indexers in C#Properties and indexers in C#
Properties and indexers in C#
 
はじめてのShiny
はじめてのShinyはじめてのShiny
はじめてのShiny
 
Vi Cheat Sheet
Vi Cheat SheetVi Cheat Sheet
Vi Cheat Sheet
 
Visual Basic(Vb) practical
Visual Basic(Vb) practicalVisual Basic(Vb) practical
Visual Basic(Vb) practical
 
Data struture lab
Data struture labData struture lab
Data struture lab
 
Rプログラミング02 データ入出力編
Rプログラミング02 データ入出力編Rプログラミング02 データ入出力編
Rプログラミング02 データ入出力編
 

More from Aditi Bhushan

Chapter 15 [Bhagvad Geeta]
Chapter 15 [Bhagvad Geeta]Chapter 15 [Bhagvad Geeta]
Chapter 15 [Bhagvad Geeta]Aditi Bhushan
 
COMPUTER SCIENCE CLASS 11
COMPUTER SCIENCE CLASS 11COMPUTER SCIENCE CLASS 11
COMPUTER SCIENCE CLASS 11Aditi Bhushan
 
Basics of python programming
Basics of python programmingBasics of python programming
Basics of python programmingAditi Bhushan
 
Basics of Information Technology
Basics of Information TechnologyBasics of Information Technology
Basics of Information TechnologyAditi Bhushan
 
Calculation of Area of Circle and Rectangle
Calculation of Area of Circle and RectangleCalculation of Area of Circle and Rectangle
Calculation of Area of Circle and RectangleAditi Bhushan
 
Calculation of first 100 numbers using do-until loop
Calculation of first 100 numbers using do-until loopCalculation of first 100 numbers using do-until loop
Calculation of first 100 numbers using do-until loopAditi Bhushan
 
HSc Information Technology Practical List
HSc Information Technology Practical List HSc Information Technology Practical List
HSc Information Technology Practical List Aditi Bhushan
 
HSc Computer Science Practical Slip for Class 12
HSc Computer Science Practical Slip for Class 12HSc Computer Science Practical Slip for Class 12
HSc Computer Science Practical Slip for Class 12Aditi Bhushan
 
Fibonacci Series Program in C++
Fibonacci Series Program in C++Fibonacci Series Program in C++
Fibonacci Series Program in C++Aditi Bhushan
 
Introduction to Visual basic 6.0
Introduction to Visual basic 6.0Introduction to Visual basic 6.0
Introduction to Visual basic 6.0Aditi Bhushan
 
Functional hardware of pc
Functional hardware of pcFunctional hardware of pc
Functional hardware of pcAditi Bhushan
 
Language and its Function
Language and its FunctionLanguage and its Function
Language and its FunctionAditi Bhushan
 
Teacher autonomy : a tool to create learner autonomy
Teacher autonomy : a tool to create learner autonomyTeacher autonomy : a tool to create learner autonomy
Teacher autonomy : a tool to create learner autonomyAditi Bhushan
 
Importance of body language at workplace
Importance of body language at workplaceImportance of body language at workplace
Importance of body language at workplaceAditi Bhushan
 
Role of indian govt. portal e pg pathshala
Role of indian govt. portal e pg pathshalaRole of indian govt. portal e pg pathshala
Role of indian govt. portal e pg pathshalaAditi Bhushan
 
conservation of solar energy
conservation of solar energyconservation of solar energy
conservation of solar energyAditi Bhushan
 

More from Aditi Bhushan (20)

Binary Search
Binary SearchBinary Search
Binary Search
 
Chapter 15 [Bhagvad Geeta]
Chapter 15 [Bhagvad Geeta]Chapter 15 [Bhagvad Geeta]
Chapter 15 [Bhagvad Geeta]
 
COMPUTER SCIENCE CLASS 11
COMPUTER SCIENCE CLASS 11COMPUTER SCIENCE CLASS 11
COMPUTER SCIENCE CLASS 11
 
HTML and CSS codes
HTML and CSS codesHTML and CSS codes
HTML and CSS codes
 
HTML codes 1
HTML codes 1HTML codes 1
HTML codes 1
 
Basics of python programming
Basics of python programmingBasics of python programming
Basics of python programming
 
Basics of Information Technology
Basics of Information TechnologyBasics of Information Technology
Basics of Information Technology
 
Calculation of Area of Circle and Rectangle
Calculation of Area of Circle and RectangleCalculation of Area of Circle and Rectangle
Calculation of Area of Circle and Rectangle
 
Calculation of first 100 numbers using do-until loop
Calculation of first 100 numbers using do-until loopCalculation of first 100 numbers using do-until loop
Calculation of first 100 numbers using do-until loop
 
HSc Information Technology Practical List
HSc Information Technology Practical List HSc Information Technology Practical List
HSc Information Technology Practical List
 
HSc Computer Science Practical Slip for Class 12
HSc Computer Science Practical Slip for Class 12HSc Computer Science Practical Slip for Class 12
HSc Computer Science Practical Slip for Class 12
 
Cpp source code1
Cpp source code1Cpp source code1
Cpp source code1
 
Fibonacci Series Program in C++
Fibonacci Series Program in C++Fibonacci Series Program in C++
Fibonacci Series Program in C++
 
Introduction to Visual basic 6.0
Introduction to Visual basic 6.0Introduction to Visual basic 6.0
Introduction to Visual basic 6.0
 
Functional hardware of pc
Functional hardware of pcFunctional hardware of pc
Functional hardware of pc
 
Language and its Function
Language and its FunctionLanguage and its Function
Language and its Function
 
Teacher autonomy : a tool to create learner autonomy
Teacher autonomy : a tool to create learner autonomyTeacher autonomy : a tool to create learner autonomy
Teacher autonomy : a tool to create learner autonomy
 
Importance of body language at workplace
Importance of body language at workplaceImportance of body language at workplace
Importance of body language at workplace
 
Role of indian govt. portal e pg pathshala
Role of indian govt. portal e pg pathshalaRole of indian govt. portal e pg pathshala
Role of indian govt. portal e pg pathshala
 
conservation of solar energy
conservation of solar energyconservation of solar energy
conservation of solar energy
 

Recently uploaded

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Recently uploaded (20)

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Visual Basic Source Codes for Class 11 HSc Paper 1 Practicals

  • 1. Narayana Junior College, Kalyan XI Computer Science Mentor: Aditi Bhushan Visual Basic Practical Q1. Write a V.B. Program to find grade (H, I, II, III, F) from marks given by user. Output: Program: Private Sub Command1_Click() Dim m, p, c, total As Integer Dim result As Long m = Val(Text1.Text) p = Val(Text2.Text) c = Val(Text3.Text) total = m + p + c result = (total / 3) If (result > 70) Then Label4.Caption = "H Grade" ElseIf (result < 70 And result > 60) Then Label4.Caption = "I Grade" ElseIf (result < 60 And result > 50) Then
  • 2. Narayana Junior College, Kalyan XI Computer Science Label4.Caption = "II Grade" ElseIf (result < 40 And result > 50) Then Label4.Caption = "III Grade" Else Label4.Caption = "F Grade, Fail" Label4.Font.Size = 20 End If End Sub Q.2. Write a V.B. program to find whether a number given is prime or not. Output: Program: Private Sub Command1_Click() Dim i, x As Integer x = Val(Text1.Text) For i = 2 To x - 1 If (x Mod i = 0) Then Label2.Caption = Text1.Text + " is not a prime no."
  • 3. Narayana Junior College, Kalyan XI Computer Science Exit For End If Next i If i = x Then Label2.Caption = Text1.Text + " is a PRIME no." End If End Sub Q.3. Calculate area of triangle in V.B. Private Sub Command1_Click() Dim a, b, c As Integer Dim area As Long a = Val(Text1.Text) b = Val(Text2.Text) area = 0.5 * a * b Label3.Caption = area End Sub PAGE 119, Q.3.
  • 4. Narayana Junior College, Kalyan XI Computer Science Private Sub Command1_Click() Dim over, run As Integer Dim runrate As Long over = Text1.Text run = Text2.Text If (over < 50) Then runrate = run / over Text3.Text = runrate Else Label4.Caption = "Over Cannot exceed 50" End If End Sub Private Sub Command2_Click() End End Sub