Homework 3 CAP 407 Modern Programming Tools & Techniques Iii
Homework 3 CAP 407 Modern Programming Tools & Techniques Iii
CAP 407
SUBMITTED TO-
Sarabjeet Sir
SUBMITTED BY-
SACHIN RAJ
B34
D3901
Q1. Using console application in vb.net create a namespace
withmethods to read details of student like patient_name,
registration_no, con_doctor, costperday, total days. Use member
variables, procedures ,functions to calculate the bill
display the same?
Ans-
Namespace hello
Public Class a
Public name As String
Public regno As Integer
Public a, b, c, per As Integer
Public Sub input()
Console.WriteLine("Name:")
name = Console.ReadLine()
Console.WriteLine("Registration No:")
regno = Console.ReadLine()
Console.WriteLine("Enter The Marks Of First Subject")
a = Console.ReadLine()
Console.WriteLine("Enter The Marks Of Second Subject")
b = Console.ReadLine()
Console.WriteLine("Enter The Marks Of Third Subject")
c = Console.ReadLine()
Console.WriteLine("Total Marks Is::{0}", a + b + c)
End Sub
Public Function calc()
per = (a + b + c) / 3
End If
Return per
End Function
Public Sub disp()
Console.WriteLine("Student Name is:{0}", name)
Console.WriteLine("Registration No is:{0}", regno)
End Sub
End Class
End Namespace
Module Module1
Sub Main()
Dim obj As New hello.a()
Dim c As Double
obj.input()
obj.disp()
c = obj.calc()
Console.WriteLine("Student Percentage is::{0}", c)
Console.ReadKey()
End Sub
End Module
OUTPUT
Q2. Create a widow based application to implement LIFO and FIFO
concepts in vb.net?
Ans-
Imports System.Collections.Stack
Public Class Form1
Dim stk As New Stack()
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Label1.Click
End Sub
End Sub
End Sub
If stk.Contains(a) Then
MessageBox.Show("Found")
Else
MessageBox.Show("Not Found")
End If
End Sub
End Class
Queue In Windows Form
Imports System.Collections.Queue
Public Class Form1
Dim que As New Queue()
End Sub
If a = "pop" Then
MessageBox.Show("Top Element Deleted::" & que.Dequeue)
ElseIf a = "clear" Then
que.Clear()
MessageBox.Show("All Element Cleared")
End If
End Sub
End Class
Q3. Create a windows application that calculates salary of an
emplyee. Make use of controls like textbox, listbox, combobox ,
date/time picker. Make use of
procedures and functions where ever possible?
PART- B
Imports System.IO
Imports System.Windows.Forms.Form
Public Class Form1
End If
End Sub
End Sub
End Class
Q5. Create an application in vb.net using rich text box to
implement font, colour and use of system calculator in an
application?
Ans-
End Sub
End If
End Sub
End Class
Q6. Create a window based application in VB.Net with a button.
Display a message box whenever the button is being clicked and
count the number of clicks user have done. Place a exit button
to close the application and display the number times user have
clicked the button?
Ans-
sachin += 1