Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following questions are not related. For each question create the necessary

ID: 3590243 • Letter: T

Question

The following questions are not related. For each question create the necessary code in Visual Basic to complete the task. Please try to organize the user interface so that your answer to each question is visually separated and clearly marked.  

You must enable strict type checking for this assignment.

Declare module-level variables as follows: Declare a String named MyName and initialize the value to your first name followed by your last name. Declare a DateTime variable named MyBirthDate and initialize the value to 1/1/1985. Do not use your actual birth date for privacy reasons. Declare a DateTime variable named CurrentDate and initialize the value to the current date (System.DateTime.Today) Declare a String variable LongStringDate. Initialize the variable to store the current date converted to a long date string. Declare all of the above variables as private module-level variables. Display these values in output labels. Create the labels as necessary and name them as appropriate. Do not use names like Label1, Label2 and so on.

Create a multi-line TextBox named txtInput. Create two Button control instances named btnUpper and btnLower. In the Click event handler for the respective buttons, write the code to make all of the text in the TextBox upper case or lower case, respectively. Create a button named btnClean that will remove any leading and trailing spaces from the text in the text box.

Create a Button control instance named btnAddDate. In the Button's Click event handler, write the statement to to get the current date. Then, add 30 days to the current date. Display the result in a Label named lblDateFuture. Display only the date. Do not display the time. Create a prompt to describe the output, as necessary.

Many types of credit cards have the same format. This format is XXXX-XXXX-XXXX-XXXX, where X is a digit. Create a Button named btnParseCredit and a TextBox named txtCreditCard. The dashes are embedded into the string containing the card number. Write the statements to extract each four-digit segment into String variables named Part1, Part2, Part3, and Part4. Display the results in Labelcontrol instances named lblPart1 through lblPart4.

Create a Button control instance named btnDates. Declare two variables named StartingDate and EndingDate having a data type of DateTime. Initialize the starting date to your birth date. Again, don't use your real birth date. Initialize the ending date to the current date. Write the statements that will display, in other Label controls, the number of elapsed days, hours, minutes, and seconds between the two dates. Use the TimeSpan structure to store the interval.

Create a Button control instance named btnDateCharacteristics and two Labels named lblDaylight and lblLeap. Get the current date from the system. Now determine whether daylight savings time is enabled for this date. Determine whether this date is a leap year.

Explanation / Answer

Private Sub Command1_Click_btn()
Dim textnotselected As Boolean
If textnotselected = True Then Exit Sub
Text1.SelText = StrConv(Text1.SelText, vbUpperCase)

End Sub

Private Sub Command2_Click_btn()
Dim textnotselected As Boolean
If textnotselected = True Then Exit Sub
Text1.SelText = StrConv(Text1.SelText, vbLowerCase)

End Sub

Private Sub Command3_Click_btn()
Text1.Text = ""
End Sub