Assignment associated with Visual Basic-VB.NET

This assignment is associated with VB.NET. All the detailed requirements are listed in the assignment file. You just need to send the handwritten outputs to me meaning that you write the programming code for each question step by step in a Microsoft Word File. And you must write the code based on the simple examples provided by my professor. I will attach the example sheets related to the questions in the assignment. Most importantly, you don’t need to write complex code such as the code you prepared for an Job interview. All you need to do is that writting the programming code simply based on the example sheets provided by me because those examples are the marking principle of my professor.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

CISY2320
Assignment 3
Due: March 20, 2019
Objective:
This assignment is designed to learn programming in VB.NET.
Important Note:
This assignment is due at 11:00pm midnight on Wednesday March 20, 2019. The assignment drop
box is located on the second floor in Loyola. Make sure that you submit your assignment to the
correct assignment drop box.
Questions:
1. (4 marks) Create a VB.NET Console Application that defines a function Smallest and calls
this function from the main program. The function Smallest takes three parameters, all of the
Integer data type, and returns the value of the smallest among the three parameters. The main
program should
(1) Prompt a message (using Console.WriteLine) to ask the user to input three integers.
(2) Call the built-in function Console.ReadLine three times to get the user’s input.
(3) Convert the user’s input from strings to integers.
(4) Call the function Smallest, with the user’s input as its parameters.
(5) Display the result of the function Smallest in the Console window using
Console.WriteLine.
You may assume that the user always correctly inputs integers from the keyboard, and your
program does not have to check whether the user inputs something other than integers. Print
your program and handwrite the user’s input and output at the end of the printout of your
program.
2. (3 marks) Create a VB.NET Console Application that defines a subroutine and calls this
subroutine from the main program. The subroutine takes two parameters x and y, both of which
are of the Integer data type and of the ByRef parameter passing. In the subroutine, the
following computation will be executed:
x=x+y
y=x–y
x=x–y
The main program should call the subroutine with the following combination values for the
variables for its parameters:
1, 4
9, 6
7, 3
and then display the values of the variables for the two parameters in the Console window.
Print your program and handwrite the output at the end of the printout of your program.
3. (3 marks) Create a VB.NET Console Application that does the following:
(1) Create an Integer array which contains 8 elements.
1
(2) Assign the following values to the elements in the array:
9, 1, 8, 4, 2, 6, 7, 3
(3) Use a For-loop or For-Each-loop to compute and printout the sum of all elements of
the array in the Console window.
Print your program and handwrite the output at the end of the printout of your program.
Submission:
1. A cover page that contains your name and student number.
2. The printouts of the programs.
3. The handwritten outputs.
2
delete
prt sc
insert
Module Modulei
tal
Sub Main()
Dima As Integer
Dim b As String = “10”
a = CType (b, Integer) * 3
Console.WriteLine(a)
a = 100
b = CType(a, String)
Console.WriteLine (b)
fress
Echample 27
Type
conversloh
Suncatcher
and
console sent
input
b = CStr (a)
Console.WriteLine (b)
sch
ame
b = CStr (8.88)
Console.WriteLine (b)
Ykt
b = CStr(CInt (8.88))
Console.WriteLine (b)
Console.WriteLine(”
25
26
27
28
Dim age As Integer
Dim name As String
Dim input Is Integer As Boolean = False
Do
Console.WriteLine(“Please input your name:”)
name = Console.ReadLine()
Loop Until (Not IsNumeric (name)) ‘check whether user’s input is NOT numeric
um
the
gost
of
three
rumbers
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Do
Console.WriteLine(“Please input your age:”)
b = Console.ReadLine()
‘check whether the user’s input is numeric and is an integer
If (IsNumeric(b) = True) Then
If (b = CStr (CInt (b))) Then
inputIsInteger = True
End If
End If
Loop Until (inputIsInteger)
age = CType (b, Integer) + 1
b = “Hello & name &”! You will be ” & CStr (age) & ” next year!”
Console.WriteLine (b)
End Sub
46
47
48
End Module
e Ano
funct
49
Sub Main()
Const pi As Double – 3.1415926
Const two As Integer – 2
Conat myName As String = wana”
cohortant
Dima As Integer
a two ATWO
Dimb As Double
b = 2.0 pi
Console.WriteLine(a)
.
two
humoke
In teger, By Refb
Example as: Tubrou tres
In Jumbo wadah
Desplay for
variables le.g: a=1 and 6=3)
Module Module
Jub sware By Ref a As
As Integer
d=atb
b=ab
a=ab
End Sub
End Module
Loghi a=l, b=3
Oazatb
Tb=3
a=143=4
La=1 =
ouverts
=> Las3
1671
@ begb
b=4-3=1
a=4-13
1
fo
11
%
5
2
6
&
IC
Module Modulel
1
2
3
Enan
Function abc (ByVal array() As Integer) As Integer
Return array(0) + 100
End Function
5
Sub def (ByRef array() As Integer)
array(0) = array(0) + 1
array(1) = array(1) + 1
array(2) = array(2) + 1
End Sub
Pou
a
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Sub Main()
Dim x() As Integer = {10, 9, 8)
Dim y As Integer = abc (x)
Console.WriteLine (y)
Console.WriteLine(”
Console.WriteLine (x (0))
Console.WriteLine (x (1))
Console.WriteLine (x (2))
Console.WriteLine(”
def (x)
Console.WriteLine (x (0))
Console.WriteLine (x (1))
Console.WriteLine (x (2))
End Sub
End Module
Console.WriteLine(a)
Cikample 24:compleos Function
Ituhcthol
minimum
Dhsplay for
the smaller one innemunt.
one of two
humeke variables &le.g.: ch=/
and y=3).
Modukter Module!
menemum (ByVal on As Integeb
By Val y As Integer As Integer
If Thy)
Then
Reauth y
Else
ketuth in
End If
End Function
End Module
Loore
1 h = =)
19=3
10 If |h7y/2o thue
then reuthy the function
ends, y as the minimum
o If (tyles falses
then return to the funot
endo in as the manunum.
oh
>
In this enample
0 Hi=1> y =3 Es falses
o thew
Rethth ch the
Function ends, th=) is
the minimum number.

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER