Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91351398
  • Price:- $20

Guranteed 24 Hours Delivery, In Price:- $20

Have any Question?


Related Questions in Programming Language

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As