Вы находитесь на странице: 1из 6

1. Module Asnmnt1 Sub Main() 'To Create Console Application for Expression and Area of Circle.

Dim area As Double Dim r As Integer Const pi As Double = 3.14 Console.WriteLine("Enter the Radius for the Circle to Calculate the Area") r = Console.ReadLine() area = pi * r * r 'Calculating the Area of the Circle Console.WriteLine("The Area of the Circle=" & area & " whose radius=" & r) Console.ReadKey() End Sub End Module 2. Module Asnmt2 Sub Main() 'The Program to Swap the value of two variable using Funtion without pasissing the Arguement Console.WriteLine("The Calling of Function in the Main to swap the values Entered by you.") swap() Console.ReadKey()

End Sub Sub swap() Dim num1, num2, temp As Integer Console.WriteLine("Enter Value for first Integer") num1 = Console.ReadLine() Console.WriteLine("Enter Value for Second Integer") num2 = Console.ReadLine() Console.WriteLine("Before Swapping the Values are num1=" & num1 & "and num2=" & num2) 'Swapping thye Value of the Variable temp = num1 num1 = num2 num2 = temp Console.WriteLine() Console.WriteLine("After Swapping the Values are num1=" & num1 & "and num2=" & num2) End Sub End Module

3. Module Asnmt3 Public Class Employee

Public emp_name As String Public gender As Char Public address As String Public mob As Double Sub input() Console.WriteLine("Enter the Name of the Emplyee") emp_name = Console.ReadLine() Console.WriteLine("Enter the Gender of the Emplyee") gender = Console.ReadLine() Console.WriteLine("Enter the Address of the Emplyee") address = Console.ReadLine() Console.WriteLine("Enter the mob of the Emplyee") mob = Console.ReadLine() End Sub Sub outout() Console.WriteLine("The Employee Details You have Entered are as Given Below:") Console.WriteLine("Name=" & emp_name) Console.WriteLine("Gender=" & gender) Console.WriteLine("Address=" & address) Console.WriteLine("Mobile No=" & mob)

End Sub End Class Sub Main() 'To Create a Dot net Application to craete Class for the Emplyee Details. Dim emp As New Employee Console.WriteLine("This is main n we r calling the Functions of Employee Class here:") Console.WriteLine("Enter the Information for the Employe here:") emp.input() Console.WriteLine("The Entered Information for the Employe are as follows:") emp.outout() Console.ReadKey()

End Sub End Module

4. Module Asnmt4 Structure student Public name As String Public roll As Integer Public subject As String Sub input() Console.WriteLine("Enter the name of the Student") name = Console.ReadLine() Console.WriteLine("Enter the Roll of the Student") roll = Console.ReadLine() Console.WriteLine("Enter the Subject of the Student") subject = Console.ReadLine()

End Sub End Structure Sub Main() Dim std As student std.input() Console.WriteLine("The Details of the Student are as Follows:") Console.WriteLine("Name=" & std.name) Console.WriteLine("Roll No=" & std.roll) Console.WriteLine("Name=" & std.subject) Console.ReadKey() End Sub End Module

5. Module Asnmt5

Sub Main() Dim j As Integer Console.WriteLine("Enter the No of Month to know its Name") j = Console.ReadLine() Select Case j Case 1 Console.WriteLine("January") Case 2 Console.WriteLine("February") Case 3 Console.WriteLine("March") Case 4 Console.WriteLine("April") Case 5 Console.WriteLine("May") Case 6 Console.WriteLine("June") Case 7 Console.WriteLine("July") Case 8 Console.WriteLine("August") Case 9 Console.WriteLine("September") Case 10 Console.WriteLine("October") Case 11 Console.WriteLine("November") Case 12 Console.WriteLine("December") Case 13 Console.WriteLine("There are Only 12 Months in the Year")

End Select Console.ReadKey() End Sub End Module

6. Module Asnmt6 Sub Main() Dim k As Integer Console.WriteLine("Enter a no to print the Uperside Traingle") k = Console.ReadLine() Dim i = k Dim j As Integer While i > 0 j = i While j > 0 Console.Write(" * ") j = j - 1 End While Console.WriteLine() i = i - 1 End While Console.ReadLine() End Sub End Module

7. Module Asnmt7 'To create the Exception Handling Solution. Sub Main() Dim a As Short Dim b As Short Dim c As Decimal Console.WriteLine("Enter Valuse For a and b") a = Console.ReadLine() b = Console.ReadLine() Try c = a / b Console.WriteLine(c) Catch ex As Exception When b = 0 MsgBox("Error Occour") Console.WriteLine("Error Dsvided by Zero") Finally Console.WriteLine("End of Main") End Try Console.ReadKey()

End Sub End Module

8. Module Module1 Public Class Student Public name As String Public roll As Integer Public marks As Integer Public Sub input() Console.WriteLine("Enter the Name of the Student") name = Console.ReadLine() Console.WriteLine("Enter the Roll no of the Student") roll = Console.ReadLine() Console.WriteLine("Enter the Marks of the Student") marks = Console.ReadLine() End Sub End Class Public Class Student1 Inherits Student Public Sub output() Console.WriteLine("Name=" & name) Console.WriteLine("Roll No=" & roll) Console.WriteLine("Marks=" & marks) End Sub End Class Sub Main() 'To Implement the Inheritance in .net Dim std As New Student1 Console.WriteLine("Now the Input Fuction of the Base Calss is Called By the Derved Class Object Enter the Asked Value for Student") std.input() Console.WriteLine("The Output Function of the Derived Class Prints ur Entered Values as Here:") std.output() Console.ReadKey() End Sub End Module 9. 'To calculate the Volume of the Sphere using the Interface. Module Asmnt9 Public Interface Inter Sub volume() End Interface Public Class cls Implements Inter Public Sub volume() Implements Inter.volume Dim r As Integer Dim h As Integer Dim pi = 3.14 Dim vol As Double Console.WriteLine("Enter the Radius for the Sphare") r = Console.ReadLine() Console.WriteLine("Enter the Height for the Sphare") h = Console.ReadLine() vol = 2 * pi * r * h

Console.WriteLine("The Volue of the Sphare=" & vol) End Sub End Class Sub Main() Dim c As New cls c.volume() Console.ReadKey()

End Sub End Module

10. Module Asmnt10 Sub Main() Dim nums(9) As Single Dim i As Integer Dim sum As Single sum = 0 Console.WriteLine("Enter ten values to a store array") For i = 0 To 9 nums(i) = Console.ReadLine() sum = sum + nums(i)

Next Console.WriteLine("The sum of array values =" & sum) Console.ReadKey() End Sub End Module

Вам также может понравиться