







































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








































(AFFILIATED TO BHARATHIAR UNIVERSITY) “WISDOMTREE”, NEELAMBUR, COIMBATORE–641062. NAME : REGNO :
KATHIR COLLEGE OF ARTS AND SCIENCE (AFFILIATED TO BHARATHIAR UNIVERSITY) “WISDOM TREE”, NEELAMBUR, COIMBATORE – 641 062. DEPARTMENT OF COMPUTER SCIENCE WITH DATA ANALYTICS NAME : REG.NO : SUBJECT CODE AND NAME : CLASS : Certified that this is the bonafide record of work done by Mr. /Ms. Of B.SC (Computer Science with Data Analytics) in Laboratory during the academic year 2023- 2024. Faculty Incharge Head of the Department
Program: import java.io.*; class prgone { public static void main(String args[])throws IOException { DataInputStream x=new DataInputStream(System.in); String s,s1; int start,end; System.out.println("Enter the string"); s=x.readLine(); System.out.println("Enter starting position"); start=Integer.parseInt(x.readLine()); System.out.println("Enter the ending position"); end=Integer.parseInt(x.readLine()); s1=s.substring(start,end); System.out.println("the given string is:"+s); System.out.println("The extracted string is:"+s1); } }
PROGRAM: import java.io.*; interface A { int a=1; public void getdata(); } interface B { int b=20; public void putdata(); } class C implements A,B { public void getdata() { System.out.println("the value of A:"+a); } public void putdata() { System.out.println("the value of B:"+b); } public void cal() { int sum=a+b; System.out.println("the sum of 2 number are="+sum); } } class prgtwo { public static void main(String args[]) { C c1=new C(); c1.getdata(); c1.putdata(); c1.cal(); } }
PROGRAM: import java.io.*; class prg extends Exception { prg() { String s; System.out.println("sorry your cheque is dishonoured"); } } public class prgthree { public static void main(String p[])throws IOException { DataInputStream d=new DataInputStream(System.in); int bal=10000,wd; System.out.println(); System.out.println(".........."); System.out.println("pay out of bounds"); System.out.println(".........."); System.out.println("enter the withdraw amount"); wd=Integer.parseInt(d.readLine()); if(wd>=bal) { System.out.println(); new prg(); System.out.println(); } else { System.out.println(); System.out.println("your cheque is passed"); System.out.println(); } } }
PROGRAM: import java.io.; class A extends Thread { public void run() { for(int i=1;i<=5;i++) { System.out.println(i+""+5+"="+(i5)); } System.out.println("END OF THE 1st THREAD"); } } class B extends Thread { public void run() { for(int j=1;j<=7;j++) { System.out.println(j+""+7+"="+(j*7)); } System.out.println("END OF THE 2nd THREAD"); } } class C extends Thread { public void run() {
Output: RESULT: