Find the output displayed when the button is clicked

Assignment Help Programming Languages
Reference no: EM13751553

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 Function

Reference no: EM13751553

Questions Cloud

Why the health status of the country plays an important role : List and explain reasons why the health status of the country plays an important role in its ecomic status
What groups resisted absolutism : What groups resisted absolutism? How and why did they resist? What English traditions and political ideas prevented the adoption of absolutism?
How it is possible to break wired equivalent privacy : One page describing how it is possible to break Wired Equivalent Privacy (WEP). also write summery discussion for more interaction on the subject
Multinational financial management : From the e-Activity, determine key reasons why a multinational corporation might decide to borrow in a country such as Brazil, where interest rates are high, rather than in a country like Switzerland, where interest rates are low. Provide support ..
Find the output displayed when the button is clicked : Determine the output displayed when the button is clicked
How currents events changes your perspective on the world : Explain how currents events changes your outlook or perspective on the world , with everything that's going on.
Acquisition opportunities to gain market share : In today's uncertain economic and regulatory environment for the health services industry, many organizations may be presented with merger and acquisition opportunities to gain market share and drive financial and operational efficiencies. Given t..
Developing research analysis skills : The purpose of the annotated bibliography is to assist you in developing research analysis skills including critical thinking, writing, and literature research skills. The annotated bibliography should include a paragraph for each source containin..
Discuss issues and concerns about use of portable devices : Security and Mobile Devices: Discuss issues and concerns about the use of portable devices such as tablets, smart phones and laptops

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd