Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Mastering Arrays Assignment
1. Visual Basic Programming [Lesson 1 To Lesson 7]
1 of 2
Mastering Arrays Assignment
Author: Kasun Ranga Wijeweera
Email: krw19870829@gmail.com
Date: 2020 April 13
1)
a) Start a new Visual Basic Windows Forms Application project.
b) Add a button to the form and program it according to the steps given below.
c) Declare an integer array that can hold 6 values.
d) Store values: 34, 73, 92, 21, 54, and 17 in the array respectively.
e) Use a loop to display each value in the array using message boxes.
f) Try to display the value in the array with index equals to 6.
2)
a) Start a new Visual Basic Windows Forms Application project.
b) Add a list box and a text box to the form.
c) Add a button to the form and program it according to the steps given below.
d) Declare an integer array that can hold 100 values.
e) The user is expected to put an integer into the text box.
f) The 100 integers generated by starting from the specified integer of the user and adding
one by one to it should be stored in the array.
g) Each value of the array should be displayed in the list box.
h) Note that the old content of the list box should be cleared at each click of the button.
3)
a) Start a new Visual Basic Windows Forms Application project.
b) Declare a global string array that can hold 100 values.
c) Add a text box with name TextBox1 and a button with name Button1 to the form.
d) The text inside the text box TextBox1 is set as a value of the array by clicking the button
Button1.
e) The text inside the text box TextBox1 should be cleared at each click of the button
Button1.
f) Add another text box with name TextBox2 and another button with name Button2 to the
form.
g) The text derived by concatenating each text in the array delimited by space should be
displayed in the text box TextBox2 by clicking the button Button2.
2. Visual Basic Programming [Lesson 1 To Lesson 7]
2 of 2
4)
a) Start a new Visual Basic Windows Forms Application project.
b) Add a text box, a button, and a list box to the form.
c) Program the button according to the steps given below.
d) Declare an integer array without specifying the maximum index.
e) The number of values in the array is taken through the text box.
f) A random number between 0-100 should be set as each value of the array.
g) Each value of the array should be displayed in the list box.
h) Note that the old content of the list box should be cleared at each click of the button.
5)
a) Start a new Visual Basic Windows Forms Application project.
b) Add a button to the form and program it according to the steps given below.
c) Implement the two matrices given below using two arrays.
2 5
4 7
6 3
d) Declare a suitable array to store the multiplication of the two matrices given above.
e) Write a code segment to compute the multiplication of the matrices in the first two arrays
and store the resultant matrix in the third array.
f) Use a message box to display the values of the third array.
5 6 2
3 4 1
2 4 7
5 3 6