Beruflich Dokumente
Kultur Dokumente
ASSIGNMENT
NO2 OF
MODERN
PROGRAMMING
TOOLS &
TECHNIQUES III
SUBMITTED TO SUBMITTED BY
E3801B53
BCA-MCA
Q1. Create a program to sort the elements in ascending and descending order
that is entered by the user.
Ans 1
num1 = TextBox1.Text
num2 = TextBox2.Text
num3 = TextBox3.Text
Sub Main()
Dim fact As Integer
Dim num As Integer
Dim i As Integer
fact = 1
num = 5
For i = 1 To 5
fact = fact * i
Next
Console.WriteLine("the factorial is:"& fact)
Console.ReadLine()
End Sub
End Module
End Sub
End Module
End Module
(iii) To split the string using a character.
Ans:- Module Module1
Sub main()
Dim str As String
Dim strArr() As String
Dim count As Integer
str = "vb.net split test"
strArr = str.Split(" ")
For count = 0 To strArr.Length - 1
MsgBox(strArr(count))
Next
End Sub
End Module
(iv) To use the endswith for a string
Ans:- Module Module1
Sub main()
Dim str As String
str = "VB.NET TOP 10 BOOKS"
If str.EndsWith("BOOKS") = True Then
MsgBox("The String EndsWith 'BOOKS' ")
Else
MsgBox("The String does not EndsWith 'BOOKS'")
End If
End Sub
End Module
Q4 Write a Program that implements Date and Time Functions, string &
mathematical functions
Ans:- Module tester
End Module
End Module
Volume of the room
Module volume_of_room
Function room(ByVal l As Integer, ByVal b As Integer, ByVal h As Integer)
Dim volume As Single
volume = l * b * h
Return volume
End Function
Sub Main()
Dim v, l, b, h As Single
Console.WriteLine("enter the length:")
l = Console.ReadLine
Console.WriteLine("enter the breadth:")
b = Console.ReadLine
Console.WriteLine("enter the height:")
h = Console.ReadLine
v=l*b*h
Console.WriteLine("volume_of_room=" & v)
Console.ReadLine()
End Sub
End Module
End Module