Posts

COMPUTER NETWORKS PROGRAMS

1. WRITE A PROGRAM TO MANIPULATE THE IP ADDRESS OF A SYSTEM. import java.net.*; public class inetaddrs { public static void main(String args[]) throws UnknownHostException { InetAddress local=InetAddress.getLocalHost(); System.out.println("Name :"+local.getHostName()); System.out.println("Ip Address :"+local.getHostAddress()); } } 2. WRITE A PROGRAM TO OBTAIN THE INFORMATION ABOUT THE HOST, PORTNO. PROTOCOL, FILE AND PATH. import java.lang.*; import java.io.*; import java.net.*; class url { public static void main(String args[]) throws Exception { URL obj=new URL("http://www.dreamtechpress.com:80/index.html"); System.out.println("Host Name is:"+obj.getHost()); System.out.println("Port NO is:"+obj.getPort()); System.out.println("Protocol is:"+obj.getProtocol()); System.out.println("File used is:"+obj.getFile()); System.out.println("Path used is:"+obj.getPat...

Career after M.Sc(Computer Science)

Image
Career Options After M.sc(computer Science) M.Sc(computer Science) is a Post Graduation Course of 2years duration.This course teaches the students about the recent advancements, modern trends and technologies in the field of computer applications. After completing this course there are two options to choose : a)Higher Studies : There are many higher studies options for those who have pursued M.Sc in Computer Science. Some of those options are given below. 1) M.Tech (in various Streams.) 2) M. Phil in Computer Science. 3) Ph.D in Computer Science. 4) UGC NET/SET for Junior Research Fellowship or Lecturership. b)Job Opportunities : Those who have completed M.Sc in Computer Science can find a lot of career opportunities in both private and public sector organizations.Various job types available for these postgraduates are : 1) Teacher 2) Lecturer 3) Lab Attendant 4) Programmer 5) Database Administrator 6) System Analyst 7) Bank’s IT Officer 8) IT pro...

Data Structures : Programs

1.Program for Sorting ‘n’ elements Using bubble sort technique. #include "stdio.h" #include "conio.h" void main() { int a[10],i,j,n,temp; clrscr(); printf("Enter no. of Elements:"); scanf("%d",&n); printf("Enter Values:\n"); for(i=0;i=0;i--) for(j=0;j a[j+1]) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } printf("After sorting elements are:\n"); for(i=0;i<n;i++) printf("%d\t",a[i]); getch(); } Output Enter no. of Elements:5 Enter Values: 10 55 16 89 24 After sorting elements are: 10 16 24 55 89 2.Sort given elements using Selection Sort. #include "stdio.h" #include "conio.h" void main( ) { in...

DBMS LAB : PL/SQL Programs

1. WRITE A PL/SQL PROGRAM TO CHECK THE GIVEN NUMBER IS STRONG OR NOT. SQL> Declare n number:=&n; n1 number:=n; fact number; sum1 number; r number; i number; Begin sum1:=0; while(n>0) loop r:=mod(n,10); n:=trunc(n/10); i:=1; fact:=1; while(i<=r)loop fact:=fact*i; i:=i+1; end loop; sum1:=sum1+fact; end loop; if(sum1=n1) then dbms_output.put_line(n1||' is strong number'); else dbms_output.put_line(n1||' is not a strong number'); end if; end; / Output: Enter value for n: 145 old 9: n:=&n; new 9: n:=145; 145 is strong number PL/SQL procedure successfully completed. 2. WRITE A PL/SQL PROGRAM TO CHECK THE GIVEN STRING IS PALINDROME OR NOT. SQL> Declare len number; s1 varchar2(20) := '&s1'; s2 varchar2(20); Begin len := length(s1); for i...

DBMS LAB : Cycle-IV

Lab Cycle - IV Queries 1.Create a view, which contain employee names and their manager names working in sales department. --->create view v1 as (select e.ename,n.ename as managername from emp e,emp n,dept d where e.mgr=n.empno and e.deptno=d.deptno and d.dname='sales'); View created. ============================================================================= 2. Update the employee salary by 25%, whose experience is greater than 10 years. ---> update emp set sal=sal+(sal*0.25) where round(months_between(sysdate,hiredate)/12)>10; 14 rows updated. ============================================================================= 3. Delete the employees, who completed 32 years of service. ---> delete from emp where round(months_between(sysdate,hiredate)/12)>32; 0 rows deleted. ============================================================================= 4. Determine the minimum salary of an employee and his details, who join on the...

DBMS LAB : Cycle-III

Lab Cycle - III Queries 1. For each pilot who is certified for more than three aircraft, find the eid’s and the maximum cruising range of the aircraft that he (or She) certified for. --> select c.eid,max(a.crusingrange) from certified c,aircraft a where c.aid=a.aid group by c.eid having count(eid)>3; Output EID MAX(A.CRUSINGRANGE) 142519864 8430 269734834 8430 567354612 8430 ============================================================================= 2. Find the names of pilots whose salary is less than the price of the cheapest route from Los Angeles to Honolulu. --> select ename from employees where salary<(select min(price) from flights where origin='Los Angeles' and destination='Honolulu'); Output ENAME Milo Brooks ============================================================================= 3. Find the name of the pilots certified from some Boeing aircraft. -->select ename from employees where eid i...

DBMS LAB : Cycle-II

Lab Cycle - II Queries 1. Get Suppliers Names for Suppliers who supply at least one red part. -->select sname from supplier where sno in(select sno from sp where pno in(select pno from parts where color='Red')); Output: SNAME Blake Clark Adams Smith ============================================================================= 2.Get Suppliers Names for Suppliers who do not supply part ‘P2’ --> select sname from supplier where sno in(select sno from sp where pno in(select pno from parts where pno!='P2')); Output: SNAME Blake Clark Adams Jones Smith ============================================================================= 3. Using Group by with Having Clause, Get the part numbers for all the parts supplied by more than one supplier. -->select pno,count(sno) from sp group by pno having count(sno)>1; Output: PNO COUNT(SNO) P4 2 P1 2 P3 3 P6 2 P5 2 =====================================...