Determine the output displayed when the button is clicked

Assignment Help Visual Basic Programming
Reference no: EM13809308

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: EM13809308

Questions Cloud

Evaluate the role of ethical decision-making in business org : Ethics, Compliance Auditing, and Emerging Issues Imagine that you have been tasked with creating a proposal for the new CEO of your organization for establishing an ethics program and for conducting training and compliance auditing. For this assignme..
Determine the output displayed when the button is clicked : Determine the output displayed when the button is clicked. Replace each phrase containing "Until" with an equivalent phrase containing "While", and vice versa. For instance, the phrase (Until sum = 100) would be replaced by (While sum 100)
Discuss the public policies that issue presidential powers : President Obama's use of presidential powers in the last 18 months. Identify and discuss the public policies that have been at issue using these presidential powers.
Significant capital constraints : In each of these scenarios, assume that firms do not face significant capital constraints.
Determine the output displayed when the button is clicked : Determine the output displayed when the button is clicked. Determine the output displayed when the button is clicked
Create the gui for a timekeeping or payroll system for cms : CMS Systems, Inc. is a company that provides information systems consulting services to companies in the telecom industry in the United States and the United Kingdom. create the GUI for a timekeeping/payroll system for CMS
Write a effective research about salt river in arizona : Write a effective research about Salt River in Arizona and how it is important to the phoenix area. what kind of events happens there and how people enjoy Salt River in Summer and history.
Four primary forecasting techniques : Differentiate at least two or three key elements for each of the four primary forecasting techniques and how they apply to your chosen organization.
Research and present the leading opinions and comment on the : PowerPoint presentation that examines a business issue of your choosing that has ethical implications.  For example, research the arguments (both for and against) regarding advertising to children, paying a living wage, requiring union membership, or..

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Write a loop to repeat the loop exponent number of times

Read the description of each activity carefully and thoroughly so that you understand what the problem is about i.e. what are the requirements and possible solutions for the given problem - Create a Visual Basic Windows application to calculate ..

  Change the color of the text in the redlabel to red

Write that visual basic instruction to change the color of the text in the redlabel to red.

  Miles per gallon applicationdrivers are concerned with the

miles per gallon applicationdrivers are concerned with the mileage obtained by their automobiles. one driver has kept

  Create a visual basic application

Create a visual Basic application that asks the user for two different numbers through text boxes - Then compare the numbers to see which one is higher once they push a button.

  Arithmetic calculator application

Arithmetic Calculator Application - Write an application that allows the user to enter a series of numbers and manipulate them.

  Arrays write a program using dynamic arrays to record the

write a program using dynamic arrays to record the high temperatures of last ltbrgtseven days and to display all of

  Showing data from black friday sales including cost

I need a vb application in Microsoft Visual Studio showing data from black friday sales including cost, sales prices, transportation fees, profits, losses, best selling list, and worst selling list

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms".

  Create an application that list accounts from a dictionary

Create an application that list accounts from a Dictionary Object. Create an Account Class that contains an ID, Name, and Balance.

  Technical project designing vb applications across multiple

technical project designing vb applications across multiple platformsthis assignment will contain two 2 parts written

  Write visual logic program to accept number til negative

Write a Visual Logic program which accepts a series of numbers, until the first negative value is entered. The maximum number of non-negative input values is 250.

  Develop a bankaccount windows form project

Develop a "BankAccount" windows form project, which will allow user to

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