SlideShare a Scribd company logo
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

12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
Ashwin Francis
 
.Net Framework & Languages Supported by .Net Frmaework
.Net Framework & Languages Supported by .Net Frmaework.Net Framework & Languages Supported by .Net Frmaework
.Net Framework & Languages Supported by .Net Frmaework
Pranil Dukare
 
Java static keyword
Java static keywordJava static keyword
Java static keyword
Lovely Professional University
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
rahulchamp2345
 
Node.js Event Loop & EventEmitter
Node.js Event Loop & EventEmitterNode.js Event Loop & EventEmitter
Node.js Event Loop & EventEmitter
Simen Li
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)pbarasia
 
Microsoft Excel Presentation
Microsoft Excel PresentationMicrosoft Excel Presentation
Microsoft Excel Presentation
Ram Bhandari
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
Vineeta Garg
 
Powerpoint exercise
Powerpoint exercisePowerpoint exercise
Powerpoint exerciseLindaTobago
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introductionbloodyedge03
 
OOP Assignment 03.pdf
OOP Assignment 03.pdfOOP Assignment 03.pdf
OOP Assignment 03.pdf
ARSLANMEHMOOD47
 
Java swing
Java swingJava swing
Java swing
Apurbo Datta
 
Chapter 1 Programming Fundamentals Assignment.docx
Chapter 1 Programming Fundamentals Assignment.docxChapter 1 Programming Fundamentals Assignment.docx
Chapter 1 Programming Fundamentals Assignment.docx
Shamshad
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
Google
 
Net framework
Net frameworkNet framework
Net framework
Saiteja Kaparthi
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0sanket1996
 

What's hot (20)

12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
 
.Net Framework & Languages Supported by .Net Frmaework
.Net Framework & Languages Supported by .Net Frmaework.Net Framework & Languages Supported by .Net Frmaework
.Net Framework & Languages Supported by .Net Frmaework
 
Java static keyword
Java static keywordJava static keyword
Java static keyword
 
Java input
Java inputJava input
Java input
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
 
Node.js Event Loop & EventEmitter
Node.js Event Loop & EventEmitterNode.js Event Loop & EventEmitter
Node.js Event Loop & EventEmitter
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
Microsoft Excel Presentation
Microsoft Excel PresentationMicrosoft Excel Presentation
Microsoft Excel Presentation
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
Powerpoint exercise
Powerpoint exercisePowerpoint exercise
Powerpoint exercise
 
Java practical
Java practicalJava practical
Java practical
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introduction
 
OOP Assignment 03.pdf
OOP Assignment 03.pdfOOP Assignment 03.pdf
OOP Assignment 03.pdf
 
Java swing
Java swingJava swing
Java swing
 
Chapter 1 Programming Fundamentals Assignment.docx
Chapter 1 Programming Fundamentals Assignment.docxChapter 1 Programming Fundamentals Assignment.docx
Chapter 1 Programming Fundamentals Assignment.docx
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
 
Net framework
Net frameworkNet framework
Net framework
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 

More from Aditi Bhushan

Binary Search
Binary SearchBinary Search
Binary Search
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 11
Aditi Bhushan
 
HTML and CSS codes
HTML and CSS codesHTML and CSS codes
HTML and CSS codes
Aditi Bhushan
 
HTML codes 1
HTML codes 1HTML codes 1
HTML codes 1
Aditi Bhushan
 
Basics of python programming
Basics of python programmingBasics of python programming
Basics of python programming
Aditi Bhushan
 
Basics of Information Technology
Basics of Information TechnologyBasics of Information Technology
Basics of Information Technology
Aditi 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 Rectangle
Aditi 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 loop
Aditi 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 12
Aditi Bhushan
 
Cpp source code1
Cpp source code1Cpp source code1
Cpp source code1
Aditi 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.0
Aditi Bhushan
 
Functional hardware of pc
Functional hardware of pcFunctional hardware of pc
Functional hardware of pc
Aditi Bhushan
 
Language and its Function
Language and its FunctionLanguage and its Function
Language and its Function
Aditi 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 autonomy
Aditi Bhushan
 
Importance of body language at workplace
Importance of body language at workplaceImportance of body language at workplace
Importance of body language at workplace
Aditi 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 pathshala
Aditi Bhushan
 
conservation of solar energy
conservation of solar energyconservation of solar energy
conservation of solar energy
Aditi 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

Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 

Recently uploaded (20)

Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 

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