Determine the output displayed in the text box

Assignment Help Visual Basic Programming
Reference no: EM13811133

1. Determine whether the condition is true or false. Assume a = 2 and b = 3.
((a = b) Or Not (b < a)) And ((a < b) Or (b = a + 1))

2. Determine whether or not the two conditions are equivalent - that is, whether they will be true or false for exactly the same values of the variables appearing in them.
Not ((a = b) Or (a = c)); (a <> b) And (a <> c)

3. Determine the output displayed in the text box when the button is clicked. Assume the response is B
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim letter As String
letter = InputBox("Enter A, B, or C.")
letter = letter.ToUpper
If letter = "A" Then
txtOutput.Text = "A, my name is Alice."
ElseIf letter = "B" Then
txtOutput.Text = "To be, or not to be."
ElseIf letter = "C" Then
txtOutput.Text = "Oh, say, can you see."
Else
txtOutput.Text = "Not a valid letter."
End If
End Sub

4. Identify the errors.
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
'Is your program correct?
Dim query, answer1, answer2 As String
query = "Are you sure everything in your program is correct?"
answer1 = InputBox(query)
answer1 = answer1.ToUpper.Substring(0, 1)
If answer1 = "N" Then
txtOutput.Text = "Don't patch bad code, rewrite it."
Else
query = "Does your program run correctly?"
answer2 = InputBox(query)
answer2 = answer2.ToUpper.Substring(0, 1)
If answer2 = "Y" Then
txtOutput.Text = "Congratulations."
Else
txtOutput.Text = "Something you are sure about is wrong."
End If
End Sub

5. The current calendar, called the Gregorian calendar, was introduced in 1582. Every year divisible by four was declared to be a leap year, with the exception of the years ending in 00 (that is those divisible by 100) and not divisible by 400. For instance, the years 1600 and 2000 are leap years, but 1700, 1800, and 1900 are not. Write a program that requests a year as input and states whether it is a leap year. (Test the program on the years 2008, 2009, 1900, and 2000.)

6. For each of the responses shown in the parentheses, determine the output displayed in the text box when the button is clicked.
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim yearENIAC As Integer
'Ask question and obtain answer
Dim message As String
message = "In what year was the ENIAC computer completed?"
yearENIAC = CInt(InputBox(message))
'Respond to answer
Select Case yearENIAC
Case 1945
txtOutput.Text = "Correct."
Case 1943 To 1947
txtOutput.Text = "Close, 1945."
Case Is < 1943
txtOutput.Text = "Sorry, 1945. Work on the ENIAC " & _
"began in June 1943."
Case Is > 1947
txtOutput.Text = "No, 1945. By then IBM had built " & _
"a stored-program computer."
End Select
End Sub
(1940, 1945, 1950)

7. Rewrite the code using a Select Case block.
If a = 1 Then
lstOutput.Items.Add("lambs")
End If
If ((a <= 3) And (a < 4)) Then
lstOutput.Items.Add("eat")
End If
If ((a = 5) Or (a > 7)) Then
lstOutput.Items.Add("ivy")
End If.

Reference no: EM13811133

Questions Cloud

Describe correlations and regression analyses : Describe correlations and regression analyses
Items in meeting organizational objectives : Describe the importance of the three items in meeting organizational objectives. Include at least one source other than the textbook.
Question regarding the creative organizations : Identify two (2) organizations and contrast and compare their Creative processes. Identify internal and external drivers of innovation for these organizations.
Define play a watchdog role of keeping government honest : The media is expected to play a "watchdog" role of "keeping government honest." Is the media doing this effectively. Why do you think so
Determine the output displayed in the text box : For each of the responses shown in the parentheses, determine the output displayed in the text box when the button is clicked
Write a program that asks for the amount of the bill : Write a program that asks for the amount of the bill and percentage tip and calculates the tip. The program should use variables for each of the quantities and display the outcome in a text box with a label. Test the program on a bill of $20 and a..
What is cultural geography or human geography : What is Cultural geography or Human Geography
What is the magnitude of the workers displacement : A worker leaves home at 9:00 AM, travels 40 km to the office, and then returns home at 5:00 PM. What is the magnitude of the worker's displacement during this 8-hour span of time?
What are the initial and final tensions in the string : Is the angular momentum of the block conserved - what is the final angular speed and What are the initial and final tensions in the string.

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms". This assignment will contain two (2) Parts: Written Paper and Visual Basic Prototype. The Visual Basic Prototype is not included in the total page count but is included in the e..

  Visual basic programming discussion

The use of decision logic is one of the major concepts of computer programming. The decision takes your code from being sequential to one that can take various options based on the different conditions. Determine the method of coding that you would u..

  Ticketseller

Use Visual basic 2010Visual Basic,  TicketSeller. This assignment will contain two (2) Parts: Event Planning Document and Coding phase. You must submit both parts as separate files for the completion of this assignment. Remember, you are only to de..

  Data storage & "exception error trapping"

Discussion on Data Storage and  "Exception Error Trapping".

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms".

  The implementation of server side of the application

Implementation of dynamic content, server side (backend) and database for your web site using Microsoft Visual Studio 2012

  Need help building a vwd website

Need help building a VWD website. This website may not go live. I have little progress as a family tragedy has impeded my time for school.

  To develop a visual basic console application

The aim of the assessment is to develop a Visual Basic console application that performs a number of mathematical functions. The mathematics package will be menu driven, i.e. a number of options will be displayed, and the user will be able to input w..

  Program in basic which prompts user to input two integers

Write down the program by using Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).

  Develop vb-net application that includes arrays and loops

Develop a VB.NET application that includes arrays, loops, and IF statements to do the following. Your output must also display the number of applicant(s) being interviewed.

  Visual basic program to accept numeral values

Write a VISUAL BASIC program to accept numeral values of any unit, sum up the total, calculate the average, and then Output the result with a proper unit.

  Write a visual logic program to accept series of number

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.

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