SlideShare a Scribd company logo
1. Determine the output displayed when the button is clicked.
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
‘Triple a number
Dim num As Double = 5
lstOutput.Items.Add(Triple(num))
lstOutput.Items.Add (num)
End Sub
Function Triple(ByVal x As Double) As Double
Dim num As Double = 3
Return num * x
End Function
2. Determine the output displayed when the button is clicked.
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim states, senators As Double
States = 50
Senators = 2
Senate(states * senators)
End Sub
Sub Senate (ByVal num as Double)
txtBox.Text = “the number of U.S. Senators is “ & num
End Sub
3. Find the errors.
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim word As String, number As Double
word = “seven”
number = 7
Display (word, number)
End Sub
Sub Display(ByVal num As Double, ByVal term As String)
textOutput.Text = num & “ “ & term
End Sub
4. Rewrite the program so input, processing, and output are each
performed by calls to Sub procedures.
Private Sub btnCompute_Click(...) Handles btnCompute.Click
‘Information about trees
Dim num As Integer = 7
Tree = “redwood”
ht = 362
lstBox.Items.Add(“The tallest “ & tree & “ tree in the U. S,
is “ & ht & & “ feet.”)
tree = “pine”
ht = 223
lstBox.Items.Add(“The tallest “ & tree & “ tree in the U. S.
is “ & ht & “ feet.”)
End Sub
5. Determine the output displayed when the button is clicked.
Private Sub btnDetermine_Click(...) Handles
btnDetermine.Click
Dim word As String = “”
Dim num As Integer
GetFacts(word, num)
txtOutput.text = “The first “ & num & “ letters of “ & word
& “ are “ & BegOfWord(word, num) & “.”
End Sub
Sub GetFacts(ByRef w As String, ByRef num As Integer)
w = InputBox(“enter a word: “)
n = CInt(InputBox(“Enter a number less than the length of
the word: “))
End Sub
Function BefOfWiord(ByVal word As String, ByVal num As
Integer) As String
Return word.Substring(0, num)
End Function
(Assume the two responses are Education and 3.)
6. Determine the output displayed when the button is clicked.
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim price, markdown, salesTax, finalCost as Double
InputData(price, finalCost)
finalCost = CostOfItem(price, markdown, salesTax)
DisplayOutput(price, finalCost)
End Sub
Sub InputData (ByRef price As Double, ByRef markdown As
Double, ByRef salesTax As Double)
Price = CDbl(InputBox(“Price of item: “)
Markdown = CDbl (InputBox(“Percentage discount: “))
salesTax = CDbl(InputBox(“Percentage state sales tax: “))
End Sub
Function CostOfItem(ByVal pr As Double, ByVal md As
Double, ByVal st As Double) As Double
Dim reducedPrice, cost As Double
reducedPrice = pr – ((md/100) * pr)
cost = reducedPrice + ((st / 100) * reducedPrice)
Return cost
End Function
(Assume the three responses are 125, 20, and 6)
7. Identify the errors.
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim word As String
word = InputBox("What is your favorite word?")
txtOutput.Text = "When the word is written twice, " & _
Twice(word) & " letters are used."
End Sub
Function Twice(ByVal w As String) As Integer
'Compute twice the length of a string
Dim len As Integer
Return len = 2 * w.Length
End

More Related Content

Similar to 1. Determine the output displayed when the button is clicked. Priv.docx

Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subirguest9da3a3
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subirguest9da3a3
 
Latihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/PerulanganLatihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/Perulangan
Nurul Arhaiyyu
 
Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008
atsumagaysay
 
Correction s+ rie_vb
Correction s+ rie_vbCorrection s+ rie_vb
Correction s+ rie_vb
Marwane Lamouri
 
Binary Search Program in Visual Basic 2008
Binary Search Program in Visual Basic 2008Binary Search Program in Visual Basic 2008
Binary Search Program in Visual Basic 2008
atsumagaysay
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subirguest9da3a3
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subirguest9da3a3
 
Ensayo Convergencia Informatica
Ensayo Convergencia InformaticaEnsayo Convergencia Informatica
Ensayo Convergencia Informatica
miguel camelo
 
Rumus VB-1
Rumus VB-1Rumus VB-1
Rumus VB-1
T. Astari
 
Burger doll order form
Burger doll order formBurger doll order form
Burger doll order form
Khairi Aiman
 
Stop watch and array
Stop watch and arrayStop watch and array
Stop watch and array
ArnabBandopadhyaya
 
ejemplos gambas
ejemplos gambasejemplos gambas
ejemplos gambas
eduann
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
Vj NiroSh
 
I can't get my code below to work with Option Strict On due to this part of t...
I can't get my code below to work with Option Strict On due to this part of t...I can't get my code below to work with Option Strict On due to this part of t...
I can't get my code below to work with Option Strict On due to this part of t...
hwbloom115
 
Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambas
mikyken
 

Similar to 1. Determine the output displayed when the button is clicked. Priv.docx (20)

Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Manual De Gambas
Manual De GambasManual De Gambas
Manual De Gambas
 
Latihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/PerulanganLatihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/Perulangan
 
Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008
 
Correction s+ rie_vb
Correction s+ rie_vbCorrection s+ rie_vb
Correction s+ rie_vb
 
Proyecto Blob
Proyecto BlobProyecto Blob
Proyecto Blob
 
Binary Search Program in Visual Basic 2008
Binary Search Program in Visual Basic 2008Binary Search Program in Visual Basic 2008
Binary Search Program in Visual Basic 2008
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Ensayo Convergencia Informatica
Ensayo Convergencia InformaticaEnsayo Convergencia Informatica
Ensayo Convergencia Informatica
 
Rumus VB-1
Rumus VB-1Rumus VB-1
Rumus VB-1
 
Burger doll order form
Burger doll order formBurger doll order form
Burger doll order form
 
Stop watch and array
Stop watch and arrayStop watch and array
Stop watch and array
 
ejemplos gambas
ejemplos gambasejemplos gambas
ejemplos gambas
 
Vb file
Vb fileVb file
Vb file
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 
I can't get my code below to work with Option Strict On due to this part of t...
I can't get my code below to work with Option Strict On due to this part of t...I can't get my code below to work with Option Strict On due to this part of t...
I can't get my code below to work with Option Strict On due to this part of t...
 
Metode
MetodeMetode
Metode
 
Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambas
 

More from corbing9ttj

1. Is a smile a universal nonverbal form of communication Why or wh.docx
1. Is a smile a universal nonverbal form of communication Why or wh.docx1. Is a smile a universal nonverbal form of communication Why or wh.docx
1. Is a smile a universal nonverbal form of communication Why or wh.docx
corbing9ttj
 
1. IntroductionWritten and Narrated by Professor Deni ElliottThe.docx
1. IntroductionWritten and Narrated by Professor Deni ElliottThe.docx1. IntroductionWritten and Narrated by Professor Deni ElliottThe.docx
1. IntroductionWritten and Narrated by Professor Deni ElliottThe.docx
corbing9ttj
 
1. IntroductionThe objective of this video is to introduce studen.docx
1. IntroductionThe objective of this video is to introduce studen.docx1. IntroductionThe objective of this video is to introduce studen.docx
1. IntroductionThe objective of this video is to introduce studen.docx
corbing9ttj
 
1. In the following sentence, which words are used as adjectivesT.docx
1. In the following sentence, which words are used as adjectivesT.docx1. In the following sentence, which words are used as adjectivesT.docx
1. In the following sentence, which words are used as adjectivesT.docx
corbing9ttj
 
1. In the song Tonight from the musical West Side Story, the compo.docx
1. In the song Tonight from the musical West Side Story, the compo.docx1. In the song Tonight from the musical West Side Story, the compo.docx
1. In the song Tonight from the musical West Side Story, the compo.docx
corbing9ttj
 
1. IT Diffusion Models Please respond to the followingReview th.docx
1. IT Diffusion Models Please respond to the followingReview th.docx1. IT Diffusion Models Please respond to the followingReview th.docx
1. IT Diffusion Models Please respond to the followingReview th.docx
corbing9ttj
 
1. In many ways the underworld was considered dangerous, but there w.docx
1. In many ways the underworld was considered dangerous, but there w.docx1. In many ways the underworld was considered dangerous, but there w.docx
1. In many ways the underworld was considered dangerous, but there w.docx
corbing9ttj
 
1. In Jules Henry’s view, how are values and drives related to e.docx
1. In Jules Henry’s view, how are values and drives related to e.docx1. In Jules Henry’s view, how are values and drives related to e.docx
1. In Jules Henry’s view, how are values and drives related to e.docx
corbing9ttj
 
1. If I wanted to test a certain chemical to see if it made mice run.docx
1. If I wanted to test a certain chemical to see if it made mice run.docx1. If I wanted to test a certain chemical to see if it made mice run.docx
1. If I wanted to test a certain chemical to see if it made mice run.docx
corbing9ttj
 
1. Identify a community or aggregate you are currently involved wi.docx
1. Identify a community or aggregate you are currently involved wi.docx1. Identify a community or aggregate you are currently involved wi.docx
1. Identify a community or aggregate you are currently involved wi.docx
corbing9ttj
 
1. Identify and describe the steps of the scientific method. Which o.docx
1. Identify and describe the steps of the scientific method. Which o.docx1. Identify and describe the steps of the scientific method. Which o.docx
1. Identify and describe the steps of the scientific method. Which o.docx
corbing9ttj
 
1. How many time zones are there across the world2. Which map wou.docx
1. How many time zones are there across the world2. Which map wou.docx1. How many time zones are there across the world2. Which map wou.docx
1. How many time zones are there across the world2. Which map wou.docx
corbing9ttj
 
1. How has society responded to coastal changes initiated by sand tr.docx
1. How has society responded to coastal changes initiated by sand tr.docx1. How has society responded to coastal changes initiated by sand tr.docx
1. How has society responded to coastal changes initiated by sand tr.docx
corbing9ttj
 
1. How has the economic geography of this region changed over the .docx
1. How has the economic geography of this region changed over the .docx1. How has the economic geography of this region changed over the .docx
1. How has the economic geography of this region changed over the .docx
corbing9ttj
 
1. Important nurses of the 19th century are often overshadowed by Ni.docx
1. Important nurses of the 19th century are often overshadowed by Ni.docx1. Important nurses of the 19th century are often overshadowed by Ni.docx
1. Important nurses of the 19th century are often overshadowed by Ni.docx
corbing9ttj
 
1. In what ways did the Columbian Exchange impact the Americas, .docx
1. In what ways did the Columbian Exchange impact the Americas, .docx1. In what ways did the Columbian Exchange impact the Americas, .docx
1. In what ways did the Columbian Exchange impact the Americas, .docx
corbing9ttj
 
1. How did the conditions of life among descendants of African Slave.docx
1. How did the conditions of life among descendants of African Slave.docx1. How did the conditions of life among descendants of African Slave.docx
1. How did the conditions of life among descendants of African Slave.docx
corbing9ttj
 
1. If you adopt the _______ perspective, youll reject an emphasis o.docx
1. If you adopt the _______ perspective, youll reject an emphasis o.docx1. If you adopt the _______ perspective, youll reject an emphasis o.docx
1. If you adopt the _______ perspective, youll reject an emphasis o.docx
corbing9ttj
 
1. How are information systems transforming business and what is the.docx
1. How are information systems transforming business and what is the.docx1. How are information systems transforming business and what is the.docx
1. How are information systems transforming business and what is the.docx
corbing9ttj
 
1. How can Fiedlers theory of the least preferred coworker help man.docx
1. How can Fiedlers theory of the least preferred coworker help man.docx1. How can Fiedlers theory of the least preferred coworker help man.docx
1. How can Fiedlers theory of the least preferred coworker help man.docx
corbing9ttj
 

More from corbing9ttj (20)

1. Is a smile a universal nonverbal form of communication Why or wh.docx
1. Is a smile a universal nonverbal form of communication Why or wh.docx1. Is a smile a universal nonverbal form of communication Why or wh.docx
1. Is a smile a universal nonverbal form of communication Why or wh.docx
 
1. IntroductionWritten and Narrated by Professor Deni ElliottThe.docx
1. IntroductionWritten and Narrated by Professor Deni ElliottThe.docx1. IntroductionWritten and Narrated by Professor Deni ElliottThe.docx
1. IntroductionWritten and Narrated by Professor Deni ElliottThe.docx
 
1. IntroductionThe objective of this video is to introduce studen.docx
1. IntroductionThe objective of this video is to introduce studen.docx1. IntroductionThe objective of this video is to introduce studen.docx
1. IntroductionThe objective of this video is to introduce studen.docx
 
1. In the following sentence, which words are used as adjectivesT.docx
1. In the following sentence, which words are used as adjectivesT.docx1. In the following sentence, which words are used as adjectivesT.docx
1. In the following sentence, which words are used as adjectivesT.docx
 
1. In the song Tonight from the musical West Side Story, the compo.docx
1. In the song Tonight from the musical West Side Story, the compo.docx1. In the song Tonight from the musical West Side Story, the compo.docx
1. In the song Tonight from the musical West Side Story, the compo.docx
 
1. IT Diffusion Models Please respond to the followingReview th.docx
1. IT Diffusion Models Please respond to the followingReview th.docx1. IT Diffusion Models Please respond to the followingReview th.docx
1. IT Diffusion Models Please respond to the followingReview th.docx
 
1. In many ways the underworld was considered dangerous, but there w.docx
1. In many ways the underworld was considered dangerous, but there w.docx1. In many ways the underworld was considered dangerous, but there w.docx
1. In many ways the underworld was considered dangerous, but there w.docx
 
1. In Jules Henry’s view, how are values and drives related to e.docx
1. In Jules Henry’s view, how are values and drives related to e.docx1. In Jules Henry’s view, how are values and drives related to e.docx
1. In Jules Henry’s view, how are values and drives related to e.docx
 
1. If I wanted to test a certain chemical to see if it made mice run.docx
1. If I wanted to test a certain chemical to see if it made mice run.docx1. If I wanted to test a certain chemical to see if it made mice run.docx
1. If I wanted to test a certain chemical to see if it made mice run.docx
 
1. Identify a community or aggregate you are currently involved wi.docx
1. Identify a community or aggregate you are currently involved wi.docx1. Identify a community or aggregate you are currently involved wi.docx
1. Identify a community or aggregate you are currently involved wi.docx
 
1. Identify and describe the steps of the scientific method. Which o.docx
1. Identify and describe the steps of the scientific method. Which o.docx1. Identify and describe the steps of the scientific method. Which o.docx
1. Identify and describe the steps of the scientific method. Which o.docx
 
1. How many time zones are there across the world2. Which map wou.docx
1. How many time zones are there across the world2. Which map wou.docx1. How many time zones are there across the world2. Which map wou.docx
1. How many time zones are there across the world2. Which map wou.docx
 
1. How has society responded to coastal changes initiated by sand tr.docx
1. How has society responded to coastal changes initiated by sand tr.docx1. How has society responded to coastal changes initiated by sand tr.docx
1. How has society responded to coastal changes initiated by sand tr.docx
 
1. How has the economic geography of this region changed over the .docx
1. How has the economic geography of this region changed over the .docx1. How has the economic geography of this region changed over the .docx
1. How has the economic geography of this region changed over the .docx
 
1. Important nurses of the 19th century are often overshadowed by Ni.docx
1. Important nurses of the 19th century are often overshadowed by Ni.docx1. Important nurses of the 19th century are often overshadowed by Ni.docx
1. Important nurses of the 19th century are often overshadowed by Ni.docx
 
1. In what ways did the Columbian Exchange impact the Americas, .docx
1. In what ways did the Columbian Exchange impact the Americas, .docx1. In what ways did the Columbian Exchange impact the Americas, .docx
1. In what ways did the Columbian Exchange impact the Americas, .docx
 
1. How did the conditions of life among descendants of African Slave.docx
1. How did the conditions of life among descendants of African Slave.docx1. How did the conditions of life among descendants of African Slave.docx
1. How did the conditions of life among descendants of African Slave.docx
 
1. If you adopt the _______ perspective, youll reject an emphasis o.docx
1. If you adopt the _______ perspective, youll reject an emphasis o.docx1. If you adopt the _______ perspective, youll reject an emphasis o.docx
1. If you adopt the _______ perspective, youll reject an emphasis o.docx
 
1. How are information systems transforming business and what is the.docx
1. How are information systems transforming business and what is the.docx1. How are information systems transforming business and what is the.docx
1. How are information systems transforming business and what is the.docx
 
1. How can Fiedlers theory of the least preferred coworker help man.docx
1. How can Fiedlers theory of the least preferred coworker help man.docx1. How can Fiedlers theory of the least preferred coworker help man.docx
1. How can Fiedlers theory of the least preferred coworker help man.docx
 

Recently uploaded

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
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
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
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
 
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
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
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
 
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
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 

Recently uploaded (20)

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
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
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
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
 
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
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
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.
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 

1. Determine the output displayed when the button is clicked. Priv.docx

  • 1. 1. Determine the output displayed when the button is clicked. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click ‘Triple a number Dim num As Double = 5 lstOutput.Items.Add(Triple(num)) lstOutput.Items.Add (num) End Sub Function Triple(ByVal x As Double) As Double Dim num As Double = 3 Return num * x End Function 2. Determine the output displayed when the button is clicked. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim states, senators As Double States = 50 Senators = 2 Senate(states * senators) End Sub Sub Senate (ByVal num as Double) txtBox.Text = “the number of U.S. Senators is “ & num End Sub 3. Find the errors. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim word As String, number As Double word = “seven” number = 7 Display (word, number) End Sub Sub Display(ByVal num As Double, ByVal term As String) textOutput.Text = num & “ “ & term End Sub 4. Rewrite the program so input, processing, and output are each performed by calls to Sub procedures. Private Sub btnCompute_Click(...) Handles btnCompute.Click ‘Information about trees
  • 2. Dim num As Integer = 7 Tree = “redwood” ht = 362 lstBox.Items.Add(“The tallest “ & tree & “ tree in the U. S, is “ & ht & & “ feet.”) tree = “pine” ht = 223 lstBox.Items.Add(“The tallest “ & tree & “ tree in the U. S. is “ & ht & “ feet.”) End Sub 5. Determine the output displayed when the button is clicked. Private Sub btnDetermine_Click(...) Handles btnDetermine.Click Dim word As String = “” Dim num As Integer GetFacts(word, num) txtOutput.text = “The first “ & num & “ letters of “ & word & “ are “ & BegOfWord(word, num) & “.” End Sub Sub GetFacts(ByRef w As String, ByRef num As Integer) w = InputBox(“enter a word: “) n = CInt(InputBox(“Enter a number less than the length of the word: “)) End Sub Function BefOfWiord(ByVal word As String, ByVal num As Integer) As String Return word.Substring(0, num) End Function (Assume the two responses are Education and 3.) 6. Determine the output displayed when the button is clicked. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim price, markdown, salesTax, finalCost as Double InputData(price, finalCost) finalCost = CostOfItem(price, markdown, salesTax) DisplayOutput(price, finalCost) End Sub
  • 3. Sub InputData (ByRef price As Double, ByRef markdown As Double, ByRef salesTax As Double) Price = CDbl(InputBox(“Price of item: “) Markdown = CDbl (InputBox(“Percentage discount: “)) salesTax = CDbl(InputBox(“Percentage state sales tax: “)) End Sub Function CostOfItem(ByVal pr As Double, ByVal md As Double, ByVal st As Double) As Double Dim reducedPrice, cost As Double reducedPrice = pr – ((md/100) * pr) cost = reducedPrice + ((st / 100) * reducedPrice) Return cost End Function (Assume the three responses are 125, 20, and 6) 7. Identify the errors. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim word As String word = InputBox("What is your favorite word?") txtOutput.Text = "When the word is written twice, " & _ Twice(word) & " letters are used." End Sub Function Twice(ByVal w As String) As Integer 'Compute twice the length of a string Dim len As Integer Return len = 2 * w.Length End