Assignment#5 VB INSTRUCTIONS In this assignment you will be writing two procedur
ID: 3680468 • Letter: A
Question
Assignment#5 VB
INSTRUCTIONS
In this assignment you will be writing two procedures that display a multiplication table on the screen. In one instance, the values inside the multiplication table will be displayed with a 2D array, and in the other instance, the multiplication table will be displayed using a 2D jagged array. When your program begins, the user should be prompted for a number of rows, number of columns, and a display technique (regular 2D array or jagged 2D array). After getting the input from the user, the program should call a function that neatly displays the multiplication table using the requested technique. You should be passing the number of rows and columns into each procedure when the call is made. Once the table has been displayed, the user should be given the option to give another set of values and an alternate display technique, or to exit the program. Keep all of the controlling logic for the program in Main() and all of the table drawing logic in the procedures. Make your user interface and output as neat and organized as possible.
Explanation / Answer
Hi below i have written an sample example code for your understanding using VB,It display a multiplication table for numbers 1 to 10 on the screen using 2D display. Let us design a simple GUI for this project with one Button and one Label, and write the code in the click event procedure of the Button.
Public Class Form1
Private Sub btnDisplay_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim Row As Integer
Dim Col As Integer
Dim Length As Integer
Dim Product As Integer
Dim strProduct As String
lblShow .Text =""
For Row = 1 to 10
For Col=1 to 10
Product=Row*Col
strProduct = Product .ToString
For Length=4 to strProduct .Length step -1
strProduct = " " & strProduct
Next
lblShow .Text &= strProduct
Next
lblShow .Text &= vbCrLf
Next
End Sub
End Class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.