PRACTICAL RECORD NOTE BOOK ANNA UNIVERSITY
DEPARTMENT OF INFORMATION TECHNOLOGY LCR COLLEGE OF ENGINEERING & TECHNOLOGY KANCHIPADI, THIRUTHANI TALUK THIRUVALLUR DIST – 631 204.
PRACTICAL RECORD NOTE BOOK ANNA UNIVERSITY
LCR COLLEGE OF ENGINEERING & TECHNOLOGY
NAME………………………………..
COURSE:
REG.NO………………………………
SEMESTER:
This is certified to be the bonafide record of work done by the student in the Software Components Lab(IT1403) of LCR College of Engineering and Technology in the department of Information Technology during the year Nov-2008
Head Of the Department
Staff-In-Charge
Submitted for the practical examination held on………………………..
Internal Examiner
External Examiner
INDEX
Exp.No 1 2 3 4 5 6
7
8 9 10
DATE
PROGRAM
Addition Using Java Finding Greatest Number Using Java Date And Time Application Using Visual Basics Calculator Application Using Component In Visual Basics Component Implementation In Visual Basics Arithmetic Operation Using RMI Text And Image Display Using RMI Simple Hello Program Using CORBA in Java Arithmetic Implementation Using CORBA In Java Services In CORBA Stock Market
PAGE SIGNATURE NO
sum.java import java.io.*; public class sum { public static void main(String args[])throws IOException { int i,sum=0; for(i=0;i<30;i++) sum=sum+i; System.out.println("The Sum is :"+sum); } }
OUTPUT:
Great.java import java.io.*; class great { public static void main(String args[])throws IOException { int a,b,c; String s; DataInputStream dis=new DataInputStream(System.in); System.out.print("Enter A:"); s=dis.readLine(); a=Integer.parseInt(s); System.out.print("Enter B:"); s=dis.readLine(); b=Integer.parseInt(s); if(a>b) System.out.println("Greatest is:"+a); else System.out.println("Greatest is:"+b); } }
OUTPUT
Application using com SOURCE CODE : 1. CREATION Public Function timer() MsgBox Now End Function 2. IMPLEMENTATION Private Sub Command1_Click() Dim A As New Time.Class1 A.Timer End Sub
FORM DESIGN :
OUTPUT :
:
Active x control using calculator SOURCE CODE : Dim flag As String Dim sum As Integer Dim cur As Integer Dim cl As Integer Private Sub Command1_Click() If (cl = 1) Then Text1.Text = "" End If Text1.Text = Text1.Text & 1 cur = Val(Text1.Text) cl = 0 End Sub Private Sub Command10_Click() If (cl = 1) Then Text1.Text = "" End If Text1.Text = Text1.Text & 0 cur = Val(Text1.Text) cl = 0 End Sub Private Sub Command11_Click() Text1.Text = Text1.Text + "." End Sub Private Sub Command12_Click() arifn flag = "+" Text1.Text = sum cl = 1 End Sub Private Sub Command13_Click() arifn flag = "*" Text1.Text = sum
cl = 1 End Sub Private Sub Command14_Click() arifn flag = "-" Text1.Text = sum cl = 1 End Sub Private Sub Command15_Click() arifn flag = "/" Text1.Text = sum cl = 1 End Sub Private Sub Command17_Click() arifn flag = "=" Text1.Text = sum End Sub Private Sub Command18_Click() Text1.Text = "" sum = 0 cl = 0 flag = "+" cur = 0 End Sub Private Sub Command2_Click() If (cl = 1) Then Text1.Text = "" End If Text1.Text = Text1.Text & 2 cl = 0 cur = Val(Text1.Text) End Sub Private Sub Command3_Click() If (cl = 1) Then Text1.Text = "" End If
Text1.Text = Text1.Text & 3 cl = 0 cur = Val(Text1.Text) End Sub Private Sub Command4_Click() If (cl = 1) Then Text1.Text = "" End If Text1.Text = Text1.Text & 4 cl = 0 cur = Val(Text1.Text) End Sub Private Sub Command5_Click() If (cl = 1) Then Text1.Text = "" End If Text1.Text = Text1.Text & 5 cl = 0 cur = Val(Text1.Text) End Sub Private Sub Command6_Click() If (cl = 1) Then Text1.Text = "" End If cl = 0 Text1.Text = Text1.Text & 6 cur = Val(Text1.Text) End Sub Private Sub Command7_Click() If (cl = 1) Then Text1.Text = "" End If Text1.Text = Text1.Text & 7 cur = Val(Text1.Text) cl = 0 End Sub Private Sub Command8_Click() If (cl = 1) Then
Text1.Text = "" End If Text1.Text = Text1.Text & 8 cur = Val(Text1.Text) cl = 0 End Sub Private Sub Command9_Click() If (cl = 1) Then Text1.Text = "" End If Text1.Text = Text1.Text & 9 cl = 0 cur = Val(Text1.Text) End Sub Private Sub Form_Load() sum = 0 cl = 0 flag = "+" End Sub Private Sub arifn() Select Case flag Case "+" sum = sum + cur Case "-" sum = sum - cur Case "*" sum = sum * cur Case "/" sum = sum / cur End Select End Sub
FORM DESIGN :
OUTPUT :
Active x control using progressbar SOURCE CODE : Private sub check1_click() If check1.value=1 then Timer1.enabled=true Else Timer1.enabled=false End if End sub Private sub command1_click ProgressBar1.value=0 Check1.value=false End sub Private sub text1_change() Timer1.interval=Val(text1) End sub Private sub timer1_timer() If ProgressBar1.value<80 then ProgressBar1.value=ProgressBar1.value+1 Else Timer1.enabled=false End if End sub
FORM DESIGN :
OUTPUT :
CountRMI.java public interface countRMI extends java.rmi.Remote { public double sum1(double v1, double v2,char ch)throws java.rmi.RemoteException; }
CountRMIClient.java import java.rmi.*; import java.rmi.registry.*; import java.rmi.server.*; public class countRMIClient { public static void main(String args[]) { try { countRMI mycount=(countRMI)Naming.lookup("rmi://"+args[0]+ "/"+"countRMI"); System.out.println("RMI Arithmetic Operation"); System.out.println( "Addition Value System.out.println( "Subtraction Value System.out.println( "Multiplication Value System.out.println( "Divide Value }catch(Exception e){} } }
=" =" =" ="
+ + + +
mycount.sum1(10,15,'+') ); mycount.sum1(10,15,'-') ); mycount.sum1(10,15,'*') ); mycount.sum1(10,15,'/') );
CountRMIImpl.java import java.rmi.*; import java.rmi.server.UnicastRemoteObject; public class countRMIImpl extends UnicastRemoteObject implements countRMI { private double sum; public countRMIImpl(String name)throws RemoteException { super(); try { Naming.rebind(name,this); } catch(Exception e) { System.out.println("Exception"); e.printStackTrace(); } }
public double sum1(double v1 ,double v2,char ch) throws RemoteException { switch(ch) { case '+': sum = v1 + v2; break; case '-': sum = v1 - v2; break; case '*': sum = v1 * v2; break; case '/': sum = v1 / v2; break; } return sum; } }
CountRMIServer.java import java.rmi.*; import java.rmi.server.*; public class countRMIServer { public static void main(String s[]) { try { countRMIImpl mycount = new countRMIImpl("countRMI"); System.out.println("Count RMI Server Ready"); }catch(Exception e){} } }
OUTPUT
CountRMI.java
public interface countRMI extends java.rmi.Remote { public int decide(int choice)throws java.rmi.RemoteException; }
CountRMIImpl.java import java.rmi.*; import java.rmi.server.UnicastRemoteObject;
public class countRMIImpl extends UnicastRemoteObject implements countRMI { private double sum; public countRMIImpl(String name)throws RemoteException { super(); try { Naming.rebind(name,this); } catch(Exception e) { System.out.println("Exception"); e.printStackTrace(); } }
public int decide(int choice)throws RemoteException { return choice; } }
CountRMIClient.java
import java.io.*; import java.rmi.*; import java.rmi.registry.*; import java.rmi.server.*; import java.awt.*; import java.awt.event.*; import java.applet.*;
/*