Professional Documents
Culture Documents
1
Software Laboratory
3 Write a program to demonstrate the use of delegates, callbacks, and synchronous and
asynchronous method invocation.
2
Software Laboratory
Aim: - Write a program to create student database to implement Object Oriented features such
as: Class, Object, Method, String, Vector, Exception Handling etc.
Steps:
1. Define a class that declares data types to store student information. (Data
types like strings are used to store student name, address, branch, subject names
etc.)
2. Define another class which will inherit the first class as well defines methods
to perform operations on student information. It defines menu to perform different
operations on Student record such as: ADD Record, Display, Search, Update,
Delete etc.
3. Second class creates a vector that stores instance (objects) of first class with
new student record. Vector Provide different inbuilt functions like elementAt,
addElement, removeAll etc. using them we can perform any operation on Vector.
4. Second class also defines Main method. In this class make object of the
classes and access the variables defined in classes. Then performs specified
operation using that objects.
Conclusion :
3
Software Laboratory
Aim: - Write a program to implement Multilevel Inheritance with access specifiers for
calculation of Employee salary on daily basis for both teaching and non-teaching
staff. Use following Structure
Employee
Lecturer TA
Ass. Professor
(monthly )
Visiting
Regular (Hourly)
aid)
Steps:
1 Define all classes as per shown in above fig. that declares data types to store
Employee Information. (Data types like strings are used to store Emp name,
address, branch, ID etc.)
2 Figure shows multiple levels of inheritance. Each class inherits properties of
Parent class including own properties. (using interface we can implement multiple
inheritance).
3 First class defines menu to perform different operations on Employee record such
as: ADD Record, Display, Search, Update, Delete etc. While displaying
information it computes salary of employee from basic salary.
4 First class also defines Main method. In this class make objects of different
classes and access the variables defined in classes. Then performs specified
operation using that objects using different methods defined in classes.
Conclusion :
4
Software Laboratory
Assignment No. – 2
Aim: - Write a simple Applet to illustrate event handling with interactive radio buttons to
control font style of a text field. Also provide a text box wherein the user may enter
font size.
Steps:
Conclusion :
5
Software Laboratory
Assignment No. – 3
Aim: - Write a program to display an animated clock that shows day, date and time using
multithreading.
Steps:
1. Creating threads :
In the most general sense, you create a thread by instantiating an object of type
Thread. Java defines two ways in which this can be accomplished:
• You can implement the Runnable interface.
• You can extend the Thread class, itself.
2. Implementing Runnable:
The easiest way to create a thread is to create a class that implements the Runnable
interface. Runnable abstracts a unit of executable code. You can construct a thread
on any object that implements Runnable To implement Runnable a class need only
implement a single method called run(), which is declared like this:
Public void run()
3. Extending Thread:
The second way to create a thread is to create a new class that extends Thread and
then to create an instance of that class. The extending class must override the run()
method, which is the entry point for the new thread. It must also call start() to begin
execution of the new thread.
4. Creating Clock:
To create animated clock use Applet and using different properties of Applet we can
create clock.
5. Display Clock:
By accessing system clock we can display animated clock with rotating hands.
Conclusion :
6
Software Laboratory
Assignment No. – 4
Aim: - Write a program to retrieve data from some database table using JDBC.
Steps:
1. Loading the driver
Import java.sql package
To load the driver class.for Name ( ) method is used
Class . for Name ( “ sun . jdbc.odbc.jdbcodbc driver”) ;
When the driver is loaded , it register itself with the java.sql.drivermanager class
as an available database driver
2. Making a connection with database
To open a connection to a given database
driver manager.get Connection ( ) method is used
Connection con = drivermanager.getconnection
( “ jdbc:odbc:somedb”,”user”,”password”);
3. Executing sql statements
To execute a sql query , java sql.statement class is used
Statement stmt = con.createstatement ( )
A query that returns data can be executed using the executequery ( )
Method of statement this method execute the statement and returns java.sql.resultset that
encapsulates the retrieved data
Resultset rs = stmt.executequery (“ SELECT * from some table”);
4. Process the result
Resultset returns one row at a time Next( ) method of the resultset.object can be called to
move the next row the getstring ( ) and get object ( ) methods are used for retrieving
column values
while ( rs.next ( ) )
{string event = rs.getstring ( “event”);
Object.count = (Integer)rs.getobject(“count”);
}
Conclusion :
7
Software Laboratory
Assignment No. – 5
Aim: - Write a program to implement simple Echo server using Sockets programming.
Steps:
1. Import java.net package in program.
2. Create Server Socket using socket class with specified port number.
3. Create Client socket with specified IP address which connects to server using
same port number.
4. Write a code for both server and client classes that behaves like Echo server.
5. Client sends connection request to server and once client get connected to
server they communicates each other by sending and receiving messages.
Conclusion :
8
Software Laboratory
9
Software Laboratory
Assignment No. –1
Aim: - Write a program in LISP to sort elements of array. (All Sorting Techniques)
Steps:
1. To design the LISP program that uses
• FIRST and REST
• CAR and CDR
• SETF
• CONS,APPEND and LIST
• LENGTH and REVERSE
• ASSOC
Using all above commands we can write code to implement given assignment.
2. Reference :
Chapter 1 and 2 of “ LISP” 3rd edition winston and horn , pearson education
Conclusion :
10
Software Laboratory
Assignment No. –2
Steps:
1. The program uses the functions of LISP for editor design which has facility
• Insert
• Delete
• Length
• Concatenate
• Reverse
• Search
• append
Using files we can implement line editor in LISP.
Conclusion :
11
Software Laboratory
Group: B
SYSTEM PROGRAMMING
12
Software Laboratory
Assignment No. – 1
Aim: - Design suitable data structures and develop a subset of an assembler for 8 or 16 bit
microprocessor. Subset should consist of a few instructions from each category and few
assembler directives
Steps:
ALGORITHM OF ASSEMBLER
THEORY:-
1. Imperative statement.
2. Declarative statement.
3. Assembler directive statement.
Schematic Diagram of 2 Pass Assembler Flow Chart ofPass I and Pass II.
ALGORITHM:-
Pass - I Algorithm :-
1. loc-cntr := 0;( default value)
2. pooltab-ptr := 1; POOLTAB[I] := 1; lit tab -ptr := I ;
13
Software Laboratory
14
Software Laboratory
Pass - II Algorithm:
Conclusion:
15
Software Laboratory
Assignment No. – 2
Aim: - Design suitable data structures and develop a subset of a macro assembler for 8 or 16
bit microprocessor. Facilities such as Nested Macro, Labels within Macro, Macro
Parameters, Conditional Macro Expansion, Macro Operators (%, &,<...> etc) to be
supported. Use Turbo Librarian to build and use your library code modules
Steps:
Design of Macro Preprocessor
THEORY:-
Macro Instruction
Macro Definition and Call, Advanced macro facilities.
Schematic diagram of Macro preprocessor Data Structures used.
ALGORITHM:-
I. Processin2 of Macro Definition AIQorithm
2. Process the Macro Prototype statement and form the MNT entry. a) Name = Macro
Name
b) For each positional parameter
i) Enter parameter name in PNT AB [ PNT AB -ptr ] ii) PNTAB-ptr = PNTAB-ptr +1
iii) # PP = #PP +1 c) KPDTP = KPDTP -ptr
16
Software Laboratory
.."
17
Software Laboratory
then
O = entrv no. in SSNTAB
hen
Conclusion:
18
Software Laboratory
Conclusion:
19
Software Laboratory
Aim: - Program to implement paging simulation using LRU algorithm using frames.
Steps:
Theory:-
1.What is Least Recently Used Algorithm ?
2. Explain Page fault related to LRU .
3. Benefits of LRU over other replacement algorithm ?
LRU :-
1. Take input as page frames .
2. Process the frames .
3. keep the time as main factor with each page .
4. Replace the page that has not been used for longest period of time.
5. Count the page fault .
6. Analyze the output for different reference string.
Conclusion:
20
Software Laboratory
Assignment No. – 4
Steps:
3. VC++: Enter the function's source code. Use __declspec (note the two
underscores) to export the function's symbol. Use 'extern "C"' to minimize
name mangling by VC++.
// Define DllExport to declare exported symbols.
#define DllExport __declspec( dllexport )
4. VC++: Set project options using Project\Settings. On the C/C++ tab, select the
Code Generation category. Then change Calling Convention to __stdcall.
5. VC++: Select Build\Set Active Configuration. Select the Release
configuration. Repeat step 4 to make the options apply to the release
configuration in addition to the debug configuration. Use Build\Set Active
Configuration to reselect the debug configuration if desired.
6. VC++: Build the project (press F7 or use the Build menu). This creates the
DLL file.
VB: In your Visual Basic program, declare the DLL function using the DLL file's full
path name. The function's name in the DLL file has been slightly mangled by VC++.
The name is an underscore, followed by the name you gave it, followed by "@",
followed by the number of bytes in the function's argument list. In this example the
21
Software Laboratory
name is _MyCFunc@4 because the function takes one 4 byte argument (a long
integer).
Private Declare Function MyCFunc Lib _
"C:\VBHelper\VcDll\Method1\Release\MyFuncsProject.dll" _
Alias "_MyCFunc@4" _
(ByVal x As Long) As Long
x = CInt(Text1.Text)
y = MyCFunc(x)
Label1.Caption = Str$(y)
End Sub
*** HINT: To quickly determine the mangled name of the function, find the DLL file
in Windows Explorer. Right click on the file and select the "Quick View" command.
This presents an editor showing information about the DLL. Page down 2 or 3 pages
and you will find a list of exported symbols available in the DLL. One of these will
be the mangled function name.
Conclusion:
Assignment No. – 5
22
Software Laboratory
Aim: - Design and Implement any simple application using Word/Excel Macros.
Steps:
Software requirements EXCEL AND VISUAL BASICS.
1. Enter number in Excel Sheet and use the summation formula.
2. Go in Tool -> Macro -> Record new macro. Give name to the macro then give
any
Short cut key and click OK.
3. Go in Debug -> Run -> Macro -> Edit
You will find code of Macro in VB.
Conclusion:
23
Software Laboratory
Assignment No:--6
Aim:- Using windows API develop any simple application such as Getting and
Setting Windows Information , System Colors ,Running a Progra/Files ,
Shutting down Windows.
Steps:-
b) In API viewer window , choose file then load text file then load
database file.
c) Select the functions you need for your application and then click the
copy button to copy the function declaration to the clipboard.
4) Use different functions for System Colors , Running Program / Files and
Shutting Down Windows.
Conclusion:
24
Software Laboratory
GROUP C
.NET C# PROGRAMMING
25
Software Laboratory
Assignment No. – 1
Aim: - Write a Simple C# program to compute future amount for given return for investment.
Steps:
• Creation of simple C# application that uses
• Literals, variables and data types
• Operators and expression
• Decision making and branching
Conclusion :
26
Software Laboratory
Assignment No. – 2
Aim: - Write a program to demonstrate the creation and use of custom attributes and other
features of c# (Multilevel Inheritance in C#).
Steps:
Write a C# application which uses
• Methods in C#
• Classes and objects
• Inheritance and polymorphism
• Operator overloading.
Conclusion :
27
Software Laboratory
Assignment No. – 3
Aim: - Write a program to demonstrate the use of delegates, callbacks, and synchronous and
asynchronous method invocation.and Implement any simple application using
Word/Excel Macros.
Steps:
Write a C# program to demonstrate delegates and event handeling.
• Declaration of delegates
• Define the delegates
• Invocation of the delegates
• Multicast delegates
• Use the delegates
Conclusion :
28