SlideShare ist ein Scribd-Unternehmen logo
1 von 99
EXP.NO:-01 PRELAB EXERCISE:-
BOOKDEMO:-
import java.lang.*;
import java.util.*;
class Book
{
String BKname;
int BKid;
String BKauthor;
Book(String name,int id,String author)
{
BKname = name;
BKid =id;
BKauthor = author;
}
void BKupdatedetails(String name,int id,String author)
{
BKname = name;
BKid =id;
BKauthor = author;
}
void BKdisplay()
{
System.out.println("BOOK NAME :"+BKname);
System.out.println("BOOK ID :"+BKid);
System.out.println("BOOK AUTHOR :"+BKauthor);
}
}
class BookDemo
{
public static void main(String arg[])
{
Book ob=new Book("the yogi",111,"baba");
ob.BKdisplay();
ob.BKupdatedetails("titanic",222,"cameroon james");
System.out.println("the updated details");
ob.BKdisplay();
}
}
E:java programing>javac BookDemo.java
E:java programing>java BookDemo
BOOK NAME :the yogi
BOOK ID :111
BOOK AUTHOR :baba
Updated details are :
BOOK NAME :titanic
BOOK ID :222
BOOK AUTHOR :cameroon james
EXP.NO:-01 LAB EXERCISE:-
import java.lang.*;
import java.util.*;
class Point
{
double x,y;
Point()
{
x=y=0;
}
Point(double a,double b)
{
x=a;y=b;
}
Point(Point l)
{
x=l.x;
y=l.y;
}
double Finddistance(double a,double b)
{
return (Math.sqrt((x-a)*(x-a)+(y-b)*(y-b)));
}
double Finddistance(Point l)
{
return (Math.sqrt((x-l.x)*(x-l.x)+(y-l.y)*(y-l.y)));
}
void display()
{
System.out.println("("+x+ ","+y+ ")");
}
public static void main(String args[])
{
Point p1=new Point(3.25,7.89);
Point p2=new Point(5.37,18.12);
Point p3=new Point(p2);
p1.display();
p2.display();
p3.display();
double c=p1.Finddistance(7.9,16.25);
System.out.println("distance between given points and p1 is:"+c);
c=p1.Finddistance(p3);
System.out.println("distance between p1 and p3 is:"+c);
}
}
E:java programing>javac Point.java
E:java programing>java Point
(3.25,7.89)
(5.37,18.12)
(5.37,18.12)
distance between given points and p1 is:9.566195691078036
distance between p1 and p3 is:10.447358517826409
EXP.NO:-02 PRELAB EXERCISE:-
SHAPE2D:-
import java.lang.*;
import java.util.*;
abstract class Shape2d
{
double x,y;
Shape2d(double a,double b)
{
x=a;y=b;
}
abstract double area();
abstract void display();
}
class Rectangle extends Shape2d
{
Rectangle(double a,double b)
{
super(a,b);
}
double area()
{
return(x*y);
}
void display()
{
System.out.println("length="+x+"breadth="+y+"Area of rectangle="+area());
}
}
class Triangle extends Shape2d
{
Triangle(double a,double b)
{
super(a,b);
}
double area()
{
return(0.5*x*y);
}
void display()
{
System.out.println("length="+x+"breadth="+y+"Area of triangle="+area());
}
}
class Shape2dDemo
{
public static void main(String args[])
{
Shape2d s=new Rectangle(1,2);
s.display();
s=new Triangle(1,2);
s.display();
}
}
E:java programing>javac Shape2dDemo.java
E:java programing>java Shape2dDemo
length=1.0breadth=2.0Area of rectangle=2.0
length=1.0breadth=2.0Area of triangle=1.0
EXP.NO:-02 LAB EXERCISE:-
import java.lang.*;
import java.util.*;
class Account
{
protected double balance;
protected int accnumber;
Account(int acn,double bal)
{
balance= bal;
accnumber=acn;
}
}
class SBAccount extends Account
{
SBAccount(int acno,double init_bal)
{
super(acno,init_bal);
}
void deposit(double amount)
{
if(amount>0)
{
balance+=amount;
System.out.println("current balance="+balance+"amount deposited="+amount);
}
}
void withdraw(double amount)
{
if((balance-amount)>1000)
{
balance-=amount;
System.out.println("current balance="+balance+"amount withdrawed="+amount);
}
else
System.out.println("insufficient balance found "+"current balance="+balance+"amount
withdraw request="+amount);
}
void calc_interest()
{
balance+=(0.04*balance);
System.out.println("current balance with one year interest="+balance);
}
}
class Customer
{
int custid;String name,address;
SBAccount m;
Customer(int id,String cname,String caddress,int accno,double initialbalance)
{
custid=id;
name=cname;
address=caddress;
m=new SBAccount(accno,initialbalance);
System.out.println("custid="+id+"n name="+cname+"n address="+caddress + "n
accountno=" +accno +"n balance="+initialbalance);
}
void transaction(int a)
{
Scanner s= new Scanner(System.in);
switch(a)
{
case 1:
System.out.println("enter the amount=");
a=s.nextInt();
m.deposit(a);
break;
case 2:
System.out.println("enter the amount=");
a=s.nextInt();
m.withdraw(a);
break;
case 3:
m.calc_interest();
break;
}
}
}
class BankDemo
{
public static void main(String args[])
{
Scanner s= new Scanner(System.in);
int i=0;
Customer c=new Customer(1,"harry","12,herbert town,mars",221003116,50000.00);
while(i!=1)
{
System.out.println("enter 1 for deposit ,n enter 2 for withdraw,n enter 3 for calculating
interest ,n enter 4 for exit :");
int b=s.nextInt();
if(b==4)
{
i=1;
System.out.println("visit again");
}
else
c.transaction(b);
}
}
}
E:java programing>javac BankDemo.java
E:java programing>java BankDemo
custid=1
name=harry
address=12,herbert town,mars
accountno=221003116
balance=50000.0
enter 1 for deposit ,
enter 2 for withdraw,
enter 3 for calculating interest ,
enter 4 for exit :
1
enter the amount=
500
current balance=50500.0amount deposited=500.0
enter 1 for deposit ,
enter 2 for withdraw,
enter 3 for calculating interest ,
enter 4 for exit :
2
enter the amount=
300
current balance=50200.0amount withdrawed=300.0
enter 1 for deposit ,
enter 2 for withdraw,
enter 3 for calculating interest ,
enter 4 for exit :
3
current balance with one year interest=52208.0
enter 1 for deposit ,
enter 2 for withdraw,
enter 3 for calculating interest ,
enter 4 for exit :
4
visit again
EXP.NO:-03 PRELAB EXERCISE:-
package shape2d;
import java.lang.*;
import java.util.*;
public interface twod
{
double area();
double perimeter();
}
package shape2d;
import java.lang.*;
import java.util.*;
public class Circle implements twod
{
double r;
public Circle(double a)
{
r=a;
}
public double area()
{
return (3.14*r*r);
}
public double perimeter()
{
return (2*3.14*r);
}
}
package shape2d;
import java.lang.*;
import java.util.*;
public class Rectangle implements twod
{
double l,br;
public Rectangle(double a,double b)
{
l=a;br=b;
}
public double area()
{
return (l*br);
}
public double perimeter()
{
return (2*(l+br));
}
}
package shape2d;
import java.lang.*;
import java.util.*;
public class Square implements twod
{
double side;
public Square(double x)
{
side=x;
}
public double area()
{
return (side*side);
}
public double perimeter()
{
return (4*side);
}
}
import java.lang.*;
import java.util.*;
import shape2d.*;
class ShapeDemo
{
public static void main(String args[])
{
Circle f=new Circle(1.0);
System.out.println("Area of Circle="+f.area());
System.out.println("Perimeter of Circle="+f.perimeter());
Square g=new Square(2.0);
System.out.println("Area of Square="+g.area());
System.out.println("Perimeter of Square ="+g.perimeter());
Rectangle c=new Rectangle(1.0,2.0);
System.out.println("Area of Rectangle="+c.area());
System.out.println("Perimeter of Rectangle="+c.perimeter());
}
}
E:java programing>javac shape2dtwod.java
E:java programing>javac shape2dSquare.java
E:java programing>javac shape2dRectangle.java
E:java programing>javac shape2dCircle.java
E:java programing>javac ShapeDemo.java
E:java programing>java ShapeDemo
Area of Circle=3.14
Perimeter of Circle=6.28
Area of Square=4.0
Perimeter of Square =8.0
Area of Rectangle=2.0
Perimeter of Rectangle=6.0
EXP.NO:-03 LAB EXERCISE:-
package pkbanking.pkinterface;
import java.lang.*;
import java.util.*;
public interface InterestRate
{
double sbrate=0.04;
}
package pkbanking.pkinterface;
import java.lang.*;
import java.util.*;
public interface Transaction
{
double min_balance=500.0;
void withdraw(double a);
public void deposit(double a);
}
package pkaccount;
import java.lang.*;
import java.util.*;
abstract public class Account
{
protected int accnumber;
protected double balance;
public Account(int a,double b)
{
accnumber=a;
balance=b;
}
}
package pkaccount.sb;
import java.lang.*;
import pkaccount.*;
import pkbanking.pkinterface.*;
import java.util.*;
public class SBAccount extends Account implements Transaction,InterestRate
{
public SBAccount(int an,double ib)
{
super(an,ib);
}
public void deposit(double amount)
{
if(amount>0)
{
balance+=amount;
System.out.println("current balance="+balance+"amount deposited="+amount);
}
}
public void withdraw(double amount)
{
if((balance-amount)>min_balance)
{
balance-=amount;
System.out.println("current balance="+balance+"amount withdrawed="+amount);
}
else
System.out.println("insufficient balance found "+"current balance="+balance+"amount
withdraw request="+amount);
}
public void calc_interest()
{
balance+=(sbrate*balance);
System.out.println("current balance with one year interest="+balance);
}
}
package pkcustomer;
import pkaccount.sb.*;
import java.lang.*;
import java.util.*;
public class Customer
{
int custid;
String name,address;
SBAccount m;
public Customer(int id,String cname,String caddress,int accno,double initialbalance)
{
custid=id;
name=cname;
address=caddress;
m=new SBAccount(accno,initialbalance);
System.out.println("custid="+id+"n name="+cname+"n address="+caddress + "n
accountno=" +accno +"n balance="+initialbalance);
}
public void transaction(int a)
{
Scanner s= new Scanner(System.in);
switch(a)
{
case 1:
System.out.println("enter the amount=");
a=s.nextInt();
m.deposit(a);
break;
case 2:
System.out.println("enter the amount=");
a=s.nextInt();
m.withdraw(a);
break;
case 3:
m.calc_interest();
break;
}
}
}
import java.lang.*;
import pkcustomer.*;
import java.util.*;
class BankDemo
{
public static void main(String args[])
{
Scanner s= new Scanner(System.in);
int i=0;
Customer c=new Customer(1,"harry","12,herbert town,mars",221003116,50000.00);
while(i!=1)
{
System.out.println("enter 1 for deposit ,n enter 2 for withdraw,n enter 3 for calculating
interest ,n enter 4 for exit :");
int b=s.nextInt();
if(b==4)
{
i=1;
System.out.println("visit again");
}
else
c.transaction(b);
}
}
}
E:java programing>javac pkbankingpkinterfaceInterestRate.java
E:java programing>javac pkbankingpkinterfaceTransaction.java
E:java programing>javac pkaccountAccount.java
E:java programing>javac pkaccountsbSBAccount.java
E:java programing>javac pkcustomerCustomer.java
E:java programing>javac BankDemo.java
E:java programing>java BankDemo
custid=1
name=harry
address=12,herbert town,mars
accountno=221003116
balance=50000.0
enter 1 for deposit ,
enter 2 for withdraw,
enter 3 for calculating interest ,
enter 4 for exit :
1
enter the amount=
500
current balance=50500.0amount deposited=500.0
enter 1 for deposit ,
enter 2 for withdraw,
enter 3 for calculating interest ,
enter 4 for exit :
2
enter the amount=
300
current balance=50200.0amount withdrawed=300.0
enter 1 for deposit ,
enter 2 for withdraw,
enter 3 for calculating interest ,
enter 4 for exit :
3
current balance with one year interest=52208.0
enter 1 for deposit ,
enter 2 for withdraw,
enter 3 for calculating interest ,
enter 4 for exit :
4
visit again
EXP.NO:-04 PRELAB EXERCISE:-
import java.io.*;
import java.lang.*;
import java.util.*;
class Book
{
String BKauthor;
String BKtitle;
double BKprice;
String BKpublisher;
int stockposition;
Book(String BKauthor,String BKtitle,double BKprice,String BKpublisher,int stockposition)
{
this.BKauthor=BKauthor;
this.BKtitle=BKtitle;
this.BKprice=BKprice;
this.BKpublisher=BKpublisher;
this.stockposition=stockposition;
}
int StockPos()
{return stockposition;}
String Author()
{return BKauthor;}
String Title()
{return BKtitle;}
double Price()
{return BKprice;}
void display()
{
System.out.println("nBOOK AUTHOR :"+BKauthor);
System.out.println("BOOK TITLE :"+BKtitle);
System.out.println("BOOK PRICE :"+BKprice+ "rupees");
System.out.println("BOOK PUBLISHER :"+BKpublisher);
System.out.println("BOOK STOCK POSITION :"+stockposition+" no.sn");
}
}
BOOKDEMO
class BookDemo
{
public static void main(String arg[])
{
try {
int i,y=0,z;Book ob[]=new Book[5];char c;String m,n;
DataInputStream obe=new DataInputStream(System.in);Scanner s=new Scanner(System.in);
ob[0]=new Book("Stephen Hawking","The Nature of Space and Time",1500.00,"Princeton
University Press",1);
ob[1]=new Book("Mazidi","8051microcontroller",600.00,"Dorling Kindersley",4);
ob[2]=new Book("Ali Bahrami","OOSD",300.00,"Tata McGraw Hill",10);
ob[3]=new Book("Rabindranath Tagore","Gitanjali",800.00,"Scribner",8);
ob[4]=new Book("Rabindranath Tagore","The Heart of God",1000.00,"Tuttle Publishing",3);
System.out.println("tDetails of the books are :n ");
for(i=0;i<5;i++)
{
ob[i].display();
}
do{
System.out.println("Enter the Author and Title of the Book : ");
m=obe.readLine();
n=obe.readLine();
for(i=0;i<5;i++)
{
if(ob[i].Author().equals(m))
{
if(ob[i].Title().equals(n))
{
y=1;ob[i].display();
System.out.println("ntEnter the number of copies required :");
z=Integer.parseInt(obe.readLine());
if(z<=ob[i].StockPos()&&z>0)
{System.out.println("Total amount for "+z+" copies of "+n+"Book is="+(z*ob[i].Price()));}
else if(z>ob[i].StockPos())
{ System.out.println("Required copies not in stock");}
else if(z<0)
{throw new IllegalArgumentException("Negative Number is Entered"); }
else if(z==0)
{System.out.println("Have you wont need the Book!");}
}
else
y=0;
}
}
if(y==0)System.out.println("Requested Book is not available in the BookShop");
System.out.println("Do You Wish To Buy The Book! [ Press 'n' to come out to the Book Shop
]");
c=s.next().charAt(0);
}while(c!='n');
System.out.println("tVisit Again");
}
catch(Exception e){System.out.println(e.getMessage());}
}
}
C:app>javac BookDemo.java
C:app>java BookDemo
Details of the books are :
BOOK AUTHOR :Stephen Hawking
BOOK TITLE :The Nature of Space and Time
BOOK PRICE :1500.0rupees
BOOK PUBLISHER :Princeton University Press
BOOK STOCK POSITION :1 no.s
BOOK AUTHOR :Mazidi
BOOK TITLE :8051microcontroller
BOOK PRICE :600.0rupees
BOOK PUBLISHER :Dorling Kindersley
BOOK STOCK POSITION :4 no.s
BOOK AUTHOR :Ali Bahrami
BOOK TITLE :OOSD
BOOK PRICE :300.0rupees
BOOK PUBLISHER :Tata McGraw Hill
BOOK STOCK POSITION :10 no.s
BOOK AUTHOR :Rabindranath Tagore
BOOK TITLE :Gitanjali
BOOK PRICE :800.0rupees
BOOK PUBLISHER :Scribner
BOOK STOCK POSITION :8 no.s
BOOK AUTHOR :Rabindranath Tagore
BOOK TITLE :The Heart of God
BOOK PRICE :1000.0rupees
BOOK PUBLISHER :Tuttle Publishing
BOOK STOCK POSITION :3 no.s
Enter the Author and Title of the Book :
Mazidi
8051microcontroller
BOOK AUTHOR :Mazidi
BOOK TITLE :8051microcontroller
BOOK PRICE :600.0rupees
BOOK PUBLISHER :Dorling Kindersley
BOOK STOCK POSITION :4 no.s
Enter the number of copies required :
3
Total amount for 3 copies of 8051microcontrollerBook is=1800.0
Do You Wish To Buy The Book! [ Press 'n' to come out to the Book Shop ]
k
Enter the Author and Title of the Book :
Mazidi
8051microcontroller
BOOK AUTHOR :Mazidi
BOOK TITLE :8051microcontroller
BOOK PRICE :600.0rupees
BOOK PUBLISHER :Dorling Kindersley
BOOK STOCK POSITION :4 no.s
Enter the number of copies required :
5
Required copies not in stock
Do You Wish To Buy The Book! [ Press 'n' to come out to the Book Shop ]
l
Enter the Author and Title of the Book :
Mazidi
8051microcontroller
BOOK AUTHOR :Mazidi
BOOK TITLE :8051microcontroller
BOOK PRICE :600.0rupees
BOOK PUBLISHER :Dorling Kindersley
BOOK STOCK POSITION :4 no.s
Enter the number of copies required :
-1
Negative Number is Entered
EXP.NO:-04 LAB EXERCISE:-
import java.util.*;
class OperationFailedException extends Exception{
String des;
public OperationFailedException(String d) {
des=d;
}
public OperationFailedException(String d,Throwable e) {
des=d;
System.out.println(" " + ((OperationFailedException)e).des);
}
public String toString(){
return ("Output character = "+des ) ;
}
}
class BadOperandException extends Exception{
int op;
public BadOperandException(int op1) {
op=op1;
}
public String toString(){
return ("Output character = "+op) ;
}
}
class BadOperatorException extends Exception{
char opr;
public BadOperatorException(char opr1) {
opr=opr1;
}
public String toString(){
return ("Output character = "+opr) ;
}
}
class main1
{
public static void main(String args[])
{
char s;String s1;
int i,j,res;
Scanner in=new Scanner(System.in);
System.out.println("Enter two operands and operator as input:");
i=in.nextInt();
j=in.nextInt();
s1=in.next();
s= s1.charAt(0);
try
{
if(i>10000&&i<50000)
{
try
{
if(j>500&&j<5000)
{
try{
if(s=='*')
{res=i*j;System.out.println(res);}
else if(s=='+')
{res=i+j;System.out.println(res);}
else if(s=='-')
{res=i-j;System.out.println(res);}
else if(s=='/')
{res=i/j;System.out.println(res);}
else{
OperationFailedException e=new
OperationFailedException("INVALID OPERATOR");
e.initCause(new BadOperatorException(s));
throw e;
}
}catch(OperationFailedException e)
{
System.out.println("Caught:"+e);
System.out.println("Caught:"+e.getCause());
}
}
else{
OperationFailedException e2=new OperationFailedException("INVALID
SECOND OPERAND");
OperationFailedException e1=new OperationFailedException("INVALID
OPERAND",e2);
e1.initCause(new BadOperandException(j));
throw e1;}
}
catch(OperationFailedException f)
{
System.out.println("Caught:"+f);
System.out.println("Caught:"+f.getCause());
}
}
else{
OperationFailedException e2=new OperationFailedException("INVALID FIRST
OPERAND");
OperationFailedException e1=new OperationFailedException("INVALID
OPERAND",e2);
e1.initCause(new BadOperandException(i));
throw e1;}
}
catch(OperationFailedException f)
{
System.out.println("Caught:"+f);
System.out.println("Caught:"+f.getCause());
}
}
}
C:app>javac main1.java
C:app>java main1
Enter two operands and operator as input:
20000
1000
*
20000000
C:app>java main1
Enter two operands and operator as input:
1000
1000
*
INVALID FIRST OPERAND
Caught:Output character = INVALID OPERAND
Caught:Output character = 1000
C:app>java main1
Enter two operands and operator as input:
20000
1000
$
Caught:Output character = INVALID OPERATOR
Caught:Output character = $
C:app>java main1
Enter two operands and operator as input:
20000
100
/
INVALID SECOND OPERAND
Caught:Output character = INVALID OPERAND
Caught:Output character = 100
EXP.NO:-05 PRELAB EXERCISE:-
import java.lang.*;
import java.util.*;
class factorial extends Thread
{
public void run()
{
try
{
System.out.println("FACTORIAL THREAD PRIORITY = "+this.getPriority());
Scanner s= new Scanner(System.in);
System.out.println("status of multab while completing task is:"+this.isAlive());
System.out.println("Enter the limit of factorial: ");
int n=s.nextInt();
int j=1;
for(int i=1;i<=n;i++)
{
j=j*i;
}
System.out.println("factorial of "+n+"is"+j);
Thread.sleep(500);
}
catch(InterruptedException e){}
}
}
class sum extends Thread
{
public void run()
{
System.out.println("SUM THREAD PRIORITY = "+this.getPriority());
try
{
Scanner s= new Scanner(System.in);
System.out.println("Enter the limit of sum of the series: ");
int n=s.nextInt();
int j=0;
for(int i=1;i<=n;i++)
{
j=j+i;
}
System.out.println("sum of the 1 to "+n+" numbers is"+j);
Thread.sleep(500);
}
catch(InterruptedException e){}
}
}
class multab extends Thread
{
public void run()
{
System.out.println("MULTAB THREAD PRIORITY = "+this.getPriority());
try
{
Scanner s= new Scanner(System.in);
System.out.println("Enter the limit of multiplication table: ");
int n=s.nextInt();
System.out.println("Enter the number which has to be multiplied: ");
int k=s.nextInt();
for(int i=1;i<=n;i++)
{
System.out.println(i+"*"+k+"="+(k*i));
Thread.sleep(500);
}
}
catch(InterruptedException e){}
}
}
class ThreadBasic
{
public static void main(String args[]) throws Exception
{
factorial t1=new factorial();
sum t2=new sum();
multab t3=new multab();
t1.setPriority(10);
t2.setPriority(5);
t3.setPriority(2);
t1.start();
t1.join();
System.out.println("status of multab after completing task is:"+t1.isAlive());
t2.start();
t2.join();
t3.start();
}
}
E:java programing>javac ThreadBasic.java
E:java programing>java ThreadBasic
FACTORIAL THREAD PRIORITY = 10
status of multab while completing task is:true
Enter the limit of factorial:
5
factorial of 5 is 120
status of multab after completing task is:false
SUM THREAD PRIORITY = 5
Enter the limit of sum of the series:
3
sum of the 1 to 3 numbers is 6
MULTAB THREAD PRIORITY = 2
Enter the limit of multiplication table:
2
Enter the number which has to be multiplied:
3
1*3=3
2*3=6
EXP.NO:-05 LAB EXERCISE:-
import java.util.*;
import java.lang.*;
class Queue
{
int q[],front, rear, size, len,m;
public Queue(int n)
{
size=n;
len = 0;
q = new int[size];
front =rear = -1;
}
public boolean isEmpty()
{
return front == -1;
}
public int size()
{
return len ;
}
public void add(int i)
{
if (rear == -1)
{
front = rear = 0;
q[rear] = i;
}
else if ( rear + 1 < size)
q[++rear] = i;
len++ ;
}
public int remove()
{
if (!isEmpty())
{
len-- ;
m = q[front];
if ( front == rear)
{
front = rear = -1;
}
else
front++;
} return m;
}
synchronized void get() throws InterruptedException
{
while (isEmpty())
{
Thread.sleep(1000);
System.out.println("Queue is empty " + Thread.currentThread().getName() + " is waiting
, size: " + size());
wait();
}
Thread.sleep(1000);
int i = (Integer) remove();
System.out.println("Consumed: " + i);
notify();
}
synchronized void put(int i) throws InterruptedException
{
while (size() == size)
{
Thread.sleep(1000);
System.out.println("Queue is full " + Thread.currentThread().getName() + " is waiting ,
size: " +size());
wait();
}
Thread.sleep(1000);
add(i);
System.out.println("Produced: " + i);
notify();
}
}
class Producer implements Runnable
{
Queue Qobj;
public Producer(Queue obj)
{
this.Qobj = obj;
}
public void run()
{
int counter = 0;
while (true)
{
try{ Qobj.put(counter++); }catch(Exception e){}
}
}
}
class Consumer implements Runnable
{
Queue Qobj;
public Consumer(Queue obj)
{
this.Qobj = obj;
}
public void run()
{
while (true)
{
try{ Qobj.get(); }catch(Exception e){}
}
}
}
public class ProducerConsumer
{
public static void main(String[] args)
{
int QSize = 5;
Queue q=new Queue(QSize);
new Thread(new Producer(q), "Producer").start();
new Thread(new Consumer(q), "Consumer").start();
}
}
E:java programing>javac ProducerConsumer.java
E:java programing>java ProducerConsumer
Produced: 0
Produced: 1
Produced: 2
Produced: 3
Produced: 4
Queue is full Producer is waiting , size: 5
Consumed: 0
Consumed: 1
Consumed: 2
Consumed: 3
Consumed: 4
Queue is empty Consumer is waiting , size: 0
Produced: 5
Produced: 6
Produced: 7
Produced: 8
Produced: 9
Queue is full Producer is waiting , size: 5
Consumed: 5
Consumed: 6
Consumed: 7
Consumed: 8
Consumed: 9
Queue is empty Consumer is waiting , size: 0
Produced: 10
Produced: 11
Produced: 12
Produced: 13
Produced: 14
Queue is full Producer is waiting , size: 5
Consumed: 10
.
.
.
EXP.NO:-06 PRELAB EXERCISE:-
import java.util.*;
import java.lang.*;
import java.io.*;
class ArrayList11
{
public static void main(String a[])
{
ArrayList<String> a1=new ArrayList<String>();
a1.add("hello");
a1.add("photons");
a1.add("sorry");
a1.add("space");
a1.add("comics");
ArrayList11 k=new ArrayList11();
System.out.println("Original String ArrayList=t"+a1);
k.capitalizePlurals(a1);
System.out.println("ArrayList after capitalizePlurals=t"+a1);
k.removePlurals(a1);
System.out.println("ArrayList after removing Plural words=t"+a1);
k.reverse(a1);
System.out.println("ArrayList after reversing the order of the elements in words=t"+a1);
}
public void reverse(ArrayList<String> a1)
{
Collections.reverse(a1);
}
public void capitalizePlurals(ArrayList<String> a1)
{
for(int i=0;i<a1.size();i++)
{
String s=a1.get(i);
if(s.charAt(s.length()-1)=='s')
{
a1.set(i,s.toUpperCase());
}
}
}
public void removePlurals(ArrayList<String> a1)
{
for(int i=0;i<a1.size();i++)
{
String s=a1.get(i);
if((s.charAt(s.length()-1)=='s' )||(s.charAt(s.length()-1)=='S'))
a1.remove(i);
}
}
}
E:java programing>javac ArrayList11.java
E:java programing>java ArrayList11
Original String ArrayList= [hello, photons, sorry, space, comics]
ArrayList after capitalizePlurals= [hello, PHOTONS, sorry, space, COMICS]
ArrayList after removing Plural words= [hello, sorry, space]
ArrayList after reversing the order of the elements in words= [space, sorry, hello]
EXP.NO:-06 LAB EXERCISE:-
import java.lang.*;
import java.util.*;
class Point
{
double x,y;
Point()
{
x=y=0;
}
Point(double a,double b)
{
x=a;y=b;
}
Point(Point l)
{
x=l.x;
y=l.y;
}
double Finddistance(double a,double b)
{
return (Math.sqrt((x-a)*(x-a)+(y-b)*(y-b)));
}
double Finddistance(Point l)
{
return (Math.sqrt((x-l.x)*(x-l.x)+(y-l.y)*(y-l.y)));
}
void display()
{
System.out.println("("+x+ ","+y+ ")");
}
public static void main(String args[])
{
Point p1=new Point(3.25,7.89);
Point p2=new Point(5.37,18.12);
Point p3=new Point(p2);
Point p4=new Point();
double c=p1.Finddistance(7.9,16.25);
ArrayList<Point>a1=new ArrayList<Point>();
a1.add(p1);
a1.add(p2);
a1.add(p3);
a1.add(p4);
Iterator itr=a1.iterator();
Iterator it=a1.iterator();int i=0;
while(it.hasNext())
{
i++;
Point t1,t2;
t1=(Point)it.next();
t2=(Point)it.next();
System.out.println("p[" +i+"]= ");
t1.display();
System.out.println("p["+(i+1)+"]= ");
t2.display();
double d=t1.Finddistance(t2);
System.out.println("distance between p[" +i+"]"+" and p["+(i+1)+"]"+"points are:"+d);
i++;
}
double d=p2.Finddistance(7.9,16.25);
System.out.println("given points are: ");
p2.display();
System.out.println("distance between given points and p2 is:"+d);
}
}
E:java programing>javac Point.java
E:java programing>java Point
p[1]= (3.25,7.89)
p[2]= (5.37,18.12)
distance between p[1] and p[2]points are:10.447358517826409
p[3]= (5.37,18.12)
p[4]= (0.0,0.0)
distance between p[3] and p[4]points are:18.8989761627449
given points are: (5.37,18.12)
distance between given points and p2 is: 3.146076922136521
EXP.NO:-07 PRELAB EXERCISE:-
import java.util.*;
import java.lang.*;
class TREESET
{
public static void main(String a[])
{
TreeSet<String> a1=new TreeSet<String>();
a1.add("hello");
a1.add("photons");
a1.add("sorry");
a1.add("space");
a1.add("comics");
TREESET k=new TREESET();
System.out.println("Original String TREESET=t"+a1);
k.capitalizePlurals(a1);
k.removePlurals(a1);
k.reverse(a1);
}
public void reverse(TreeSet<String> a1)
{
TreeSet <String>treereverse = new TreeSet<String>();
treereverse = (TreeSet)a1.descendingSet();
System.out.println("TREESET after reversing the order of the elements in
words=t"+treereverse);
}
public void capitalizePlurals(TreeSet<String> a1)
{
List<String> list = new ArrayList<String>(a1);
for(int i=0;i<list.size();i++)
{
String s=list.get(i);
if(s.charAt(s.length()-1)=='s')
{
list.set(i,s.toUpperCase());
}
}
a1 = new TreeSet<String>(list);
System.out.println("TREESET after capitalizePlurals = "+a1);
}
public void removePlurals(TreeSet<String> a1)
{
List<String> list = new ArrayList<String>(a1);
for(int i=0;i<list.size();i++)
{
String str=list.get(i);
if(str.charAt(str.length()-1)=='s'|| str.charAt(str.length()-1)=='S')
{
a1.remove(str);
}
}
System.out.println("TREESET after removing plurals = "+a1);
}
}
E:java programing>javac TREESET.java
Note: TREESET.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
E:java programing>java KOPT
Original String TREESET= [comics, hello, photons, sorry, space]
TREESET after capitalizePlurals = [COMICS, PHOTONS, hello, sorry, space]
TREESET after removing plurals = [hello, sorry, space]
TREESET after reversing the order of the elements in words= [space, sorry, hello]
EXP.NO:-07 LAB EXERCISE:-
import java.util.*;
import java.lang.*;
class point
{
double x,y;
point(double a,double b)
{
x=a;
y=b;
}
double find_distance(point p)
{
double dis,xd,yd;
xd=x-p.x;
yd=y-p.y;
dis=Math.sqrt(xd*xd+yd*yd);
return(dis);
}
void display()
{
System.out.print("("+x+","+y+") ");
}
}
class ComparePts implements Comparator<point>
{
public int compare(point p1,point p2)
{
point org=new point(0,0);
double d1=p1.find_distance(org);
double d2=p2.find_distance(org);
if(d1<d2)return(-1);
if(d1>d2)return(1);
else return(0);
}
}
class HPoint
{
public static void main(String a[])
{
int i;
double x,y,d1;
Scanner s=new Scanner(System.in);
point p[]=new point[10];
HashSet<point> hs=new HashSet<point>();
for(i=0;i<10;i++)
{
System.out.println("Enter x & y for point "+(i+1));
x=s.nextDouble();
y=s.nextDouble();
p[i]=new point(x,y);
hs.add(p[i]);
}
TreeSet<point> ts=new TreeSet<point>(new ComparePts());
Iterator t=hs.iterator();
while(t.hasNext())
{
point pt=(point)t.next();
ts.add(pt);
}
System.out.println("Points in ascending Order:");
Iterator t1=ts.iterator();
while(t1.hasNext())
{
point pt=(point)t1.next();
pt.display();
System.out.println();
}
System.out.println("Distance between every pair:");
Iterator it=hs.iterator();
while(it.hasNext())
{
point t3,t2;
t3=(point)it.next();
t2=(point)it.next();
d1=t3.find_distance(t2);
System.out.print("Distance between the points:");
t3.display();
t2.display();
System.out.println(" = "+d1);
}
}
}
E:java programing>javac HPoint.java
E:java programing>java HPoint
Enter x & y for point 1 1 2
Enter x & y for point 2 2 3
Enter x & y for point 3 3 4
Enter x & y for point 4 4 5
Enter x & y for point 5 5 6
Enter x & y for point 6 6 7
Enter x & y for point 7 7 8
Enter x & y for point 8 8 9
Enter x & y for point 9 9 10
Enter x & y for point 10 10 11
Points in ascending Order:
(1.0,2.0)
(2.0,3.0)
(3.0,4.0)
(4.0,5.0)
(5.0,6.0)
(6.0,7.0)
(7.0,8.0)
(8.0,9.0)
(9.0,10.0)
(10.0,11.0)
Distance between every pair:
Distance between the points:(5.0,6.0) (1.0,2.0) = 5.656854249492381
Distance between the points:(2.0,3.0) (7.0,8.0) = 7.0710678118654755
Distance between the points:(3.0,4.0) (6.0,7.0) = 4.242640687119285
Distance between the points:(10.0,11.0) (8.0,9.0) = 2.8284271247461903
Distance between the points:(9.0,10.0) (4.0,5.0) = 7.0710678118654755
EXP.NO:-08 LAB EXERCISE:-
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class tank extends Applet implements Runnable,ActionListener
{
int y=200,sf=0,rf=0;
Thread t;
Button b1,b2,b3,b4;
public void init()
{
b1=new Button("Start");
b2=new Button("Stop");
b3=new Button("Resume");
b4=new Button("Suspend");
add(b1);
add(b2);
add(b3);
add(b4);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
}
public void run()
{
for(y=200;y>120;y--)
{
try{Thread.sleep(1000);}
catch(Exception e){}
repaint();
}
}
public void actionPerformed(ActionEvent a)
{
if(a.getSource()==b1)
{
t=new Thread(this);
sf=1;
t.start();
showStatus("Thread started..");
}
if(a.getSource()==b2)
{
if(sf==1)
{
t.stop();
sf=0;
showStatus("Thread stopped..");
}
else
showStatus("Thread not started..");
}
if(a.getSource()==b3)
{
if(rf==1)
{
t.resume();
rf=0;
showStatus("Thread resumed..");
}
else
showStatus("Thread not Suspended...");
}
if(a.getSource()==b4)
{
if(sf==1)
{
t.suspend();
rf=1;
showStatus("Thread suspended..");
}
else
showStatus("Thread not Started....");
}
}
public void paint(Graphics g)
{
g.drawLine(120,120,120,200);
g.drawLine(200,120,200,200);
g.setColor(Color.blue);
g.fillRect(120,y,80,200-y);
}
}
/*<applet code=tank width=750 height=750></applet>*/
E:javaprograming>javactank.java
Note:glow1.javausesoroverridesadeprecatedAPI.
Note:Recompile with -Xlint:deprecationfordetails.
E:javaprograming>appletviewertank.java
Warning:AppletAPIandAppletViewerare deprecated.
EXP.NO:-09 PRELAB EXERCISE:-
importjava.awt.*;
importjava.awt.event.*;
publicclassAwtFrame extendsFrame implementsFocusListener,ActionListener
{
TextFieldtf1,tf2;
Buttonb1,b2;
Stringmsg="";
publicAwtFrame()
{
setTitle("LoginScreen");setBackground(Color.cyan);
Label lbl = newLabel("SASTRA DEEMEDUNIVERSITY",Label.CENTER);
lbl.setBounds(50,30,300,40);
lbl.setFont(newFont("SansSerif",Font.BOLD,20));
add(lbl);
setFont(newFont("SansSerif",Font.BOLD,10));
Label lb2=newLabel("UserName",Label.LEFT);
Label lb3=newLabel("PassWord",Label.LEFT);
tf1=newTextField("EnterUserName");
tf1.setForeground(Color.gray);
tf2=newTextField("EnterPassWord");
tf2.setForeground(Color.gray);
b1= newButton("OK");
b2=newButton("CANCEL");
add(lb2);
add(tf1);
add(lb3);
add(tf2);
add(b1);
add(b2);
tf1.setBounds(120,90,170,20);
tf2.setBounds(120,120,170,20);
lb2.setBounds(25,90,90,20);
lb3.setBounds(25,120,90,20);
b1.addActionListener(this);
b2.addActionListener(this);
tf1.addFocusListener(this);
tf2.addFocusListener(this);
b1.setBounds(100,180,80,20);
b2.setBounds(200,180,80,20);
addWindowListener(newWindowAdapter(){
publicvoidwindowClosing(WindowEvente) {System.exit(0);}});
setLayout(null);
setSize(380,300);
setVisible(true);
}
publicvoidfocusGained(FocusEventfe)
{
TextFieldt=(TextField)fe.getSource();
if(t==tf1)
{ tf1.setText("");}
else
{ tf2.setText("");}
}
publicvoidfocusLost(FocusEventfe)
{
}
publicvoidactionPerformed(ActionEventae)
{
Buttonb =(Button) ae.getSource();
if(b==b1)
{
Strings=tf2.getText();
if(s.length()>=8)
smsg="LoginSuccessful";
else
msg = "InvalidUserName / PassWord";
repaint();
}
else
{
tf1.setText("EnterUserName");
tf1.setForeground(Color.gray);
tf2.setText("EnterPassWord");
tf2.setForeground(Color.gray);
msg="";
repaint();
}
}
publicvoidpaint(Graphicsg)
{
g.drawString(msg,150,250);
}
publicstaticvoidmain(String[] args)
{
newAwtFrame();
}
}
E:javaprograming>javacAwtFrame.java
E:javaprograming>javaAwtFrame
EXP.NO:-09 LAB EXERCISE:-
importjava.awt.*;
importjava.applet.*;
importjava.awt.event.*;
publicclassstudent9extendsFrame implementsFocusListener,ItemListener
{
Stringmsg="",csg="";inti;Choice c[]=newChoice[3];Stringmelt,melt1,melt2;
List lst=new List(4,true);booleanisEmpty;booleanisnumberornot;
Label l[]=newLabel[12];intqq=0,m=1,n=1,pp=1,mm=1,nn=1;
Stringlcap[]={"RegisterNo.","Name","Gender","Degree","Branch","Yearof Study","Date of
Birth","Hobby","Address","ExtraCurricularActivities","E-Mail
Id","B.Tech","M.Tech","CSE","ECE","EEE","YouEntered"};
Checkbox h1,h2,h3;
Label p=newLabel("",Label.CENTER);
Label u=newLabel("",Label.CENTER);
Label l11=newLabel("StudentResponse Form",Label.CENTER);
Label l7=newLabel("",Label.RIGHT);
TextFieldt1=newTextField(20);
TextFieldt2=newTextField(20);
TextFieldt3=newTextField(20);
TextFieldt4=newTextField(100);
TextAreata=newTextArea("",100,100,TextArea.SCROLLBARS_BOTH);
CheckboxGroupcbg=newCheckboxGroup();
Checkbox ck1=newCheckbox("Male",false,cbg);
Checkbox ck2=newCheckbox("Female",false,cbg);
TextAreat5=newTextArea("",180,90,TextArea.SCROLLBARS_VERTICAL_ONLY);
Choice branch=newChoice();
Choice degree=newChoice();
Choice yos=newChoice();
publicstudent9()
{
for(i=0;i<7;i++)
{l[i]=newLabel(lcap[i],Label.LEFT);add(l[i]);}
for(i=7;i<11;i++)
{l[i]=newLabel(lcap[i],Label.CENTER);add(l[i]);i++;}
for(i=8;i<11;i++)
{l[i]=newLabel(lcap[i],Label.LEFT);add(l[i]);i++;}
l[11]=newLabel(lcap[16],Label.CENTER);
add(l[11]);
for(i=0;i<3;i++)
{ c[i]=newChoice();add(c[i]);}
add(p);
add(ta);
h1=newCheckbox("StampCollection");
h2=newCheckbox("ReadingNovels");
h3=newCheckbox("PlayingTennis");
addWindowListener(newmyWindowAdapter());
setBackground(Color.cyan);
setForeground(Color.black);
setLayout(null);
add(l11);
lst.add("Tennis");
lst.add("Cricket");
lst.add("BasketBall");
lst.add("Hockey");
add(t4);
add(h1);add(h2);add(h3);
add(lst);
add(t1);
add(t2);
add(t3);
add(ck1);
add(ck2);
add(branch);
add(degree);
add(yos);
degree.add(lcap[11]);
degree.add(lcap[12]);
for(i=13;i<16;i++)
branch.add(lcap[i]);
yos.add("1");add(u);
yos.add("2");
yos.add("3");
yos.add("4");
l11.setFont(newFont("SansSerif",Font.BOLD+Font.ITALIC,15));
p.setFont(new Font("SansSerif",Font.BOLD+Font.ITALIC,15));
u.setFont(new Font("SansSerif",Font.BOLD+Font.ITALIC,15));
for(inti=1;i<=31;i++)
c[0].add(""+i);
c[1].add("January");
c[1].add("February");
c[1].add("March");t1.addFocusListener(this);
c[1].add("April");t2.addFocusListener(this);
c[1].add("May");t3.addFocusListener(this);
c[1].add("June");t4.addFocusListener(this);
c[1].add("July");degree.addItemListener(this);
c[1].add("August");yos.addItemListener(this);
c[1].add("September");
c[1].add("October");
c[1].add("November");
c[1].add("December");
for(i=1990;i<2002;i++)
c[2].add(""+i);
for(i=0;i<6;i++)
l[i].setBounds(25,(60+(i*30)),90,20);
l[6].setBounds(25,240,90,20);
l[7].setBounds(425,65,100,20);
l[8].setBounds(25,290,90,20);
l[9].setBounds(450,105,150,20);
l[10].setBounds(25,400,90,20);
l[11].setBounds(450,210,90,20);ck1.addFocusListener(this);
l11.setBounds(300,40,280,20);ck2.addFocusListener(this);
lst.setBounds(480,140,150,45);lst.addFocusListener(this);
t1.setBounds(120,60,170,20);
t2.setBounds(120,90,170,20);
t3.setBounds(120,400,170,20);
t4.setBounds(120,275,150,90);
ta.setBounds(480,245,335,170);
ck1.setBounds(120,120,50,20);
ck2.setBounds(170,120,60,20);
degree.setBounds(120,150,70,20);degree.addFocusListener(this);
branch.setBounds(120,180,50,20);branch.addFocusListener(this);
yos.setBounds(120,210,30,20);yos.addFocusListener(this);
c[0].setBounds(120,240,35,20);c[0].addFocusListener(this);
c[1].setBounds(160,240,77,20);c[1].addFocusListener(this);
c[2].setBounds(243,240,50,20);c[2].addFocusListener(this);
h1.setBounds(530,65,105,20);h1.addFocusListener(this);
h2.setBounds(644,65,100,20);h2.addFocusListener(this);
h3.setBounds(750,65,100,20);h3.addFocusListener(this);
p.setBounds(300,520,400,20);
u.setBounds(200,590,400,20);
}
publicvoidfocusGained(FocusEventae)
{
if(ae.getSource()==t4)
{
if(cbg.getSelectedCheckbox()==null)
{
msg="Selectthe Gender";
mm=1;ta.setText("");
}else{
mm=0;}
}
p.setText(msg);p.setForeground(Color.red);
}
publicvoidfocusLost(FocusEventae)
{
if(ae.getSource()==t1)
{
if(t1.getText().length()!=9)
{
ta.setText("");
msg="registernumbershouldbe 9characters!";
m=1; }else{
try{
intkk=Integer.parseInt(t1.getText());isnumberornot=false;
}
catch(Exceptione)
{
isnumberornot=true;
}
if(isnumberornot)
{
msg="Charactersshouldbe avoidedforRegNo";
}
else
{
m=0;
}
}
}
else if(ae.getSource()==t2)
{
msg="";isEmpty=t2.getText()==null||t2.getText().trim().length()==0;
if(isEmpty)
{
ta.setText("");
msg="Name shouldnotbe blank";
n=1; }else{n=0;}
}
else if(ae.getSource()==t4)
{
msg="";isEmpty=t4.getText()==null||t4.getText().trim().length()==0;
if(isEmpty)
{
msg="Addressshouldnotbe blank";
nn=1;ta.setText(""); }else{nn=0;}
}
else if(ae.getSource()==t3)
{
msg="";intyo=t3.getText().lastIndexOf("@");
if(!t3.getText().endsWith("@gmail.com"))
{
msg="InvalidE-Mail ID(@gmail.comnotfound)";
pp=1;ta.setText(""); }
else
{
Stringjo=(t3.getText()).substring(0,yo);
isEmpty=jo==null||jo.trim().length()==0||jo.startsWith("");
if(isEmpty)
{
msg="InvalidE-Mail Id(charactersisnotpresentbefore@ORfirstletterisnull)";
pp=1;ta.setText(""); }else{pp=0;}
}
}
else
{
csg="Atlastselectthe YOU ENTERED TextAreaforupdation";
u.setText(csg);u.setForeground(Color.red); }
if(mm==0&&nn==0&&pp==0&&qq==0&&m==0&&n==0)
{
if(cbg.getSelectedCheckbox().getLabel()=="Male")
{
melt="He";melt1="His";melt2="Shri";
}
if(cbg.getSelectedCheckbox().getLabel()=="Female")
{
melt="She";melt1="Her";melt2="Sow";
}
Stringdob,ptr="",pho[],h="";
pho=lst.getSelectedItems();
for(inti=0;i<pho.length;i++)
{ptr+=pho[i];if(i!=pho.length-1){ptr+=",";}}
dob=c[0].getSelectedItem()+"-"+c[1].getSelectedItem()+"-"+c[2].getSelectedItem();
if(h1.getState()){h+=h1.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
if(h2.getState()){h+=","+h2.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
if(h3.getState()){h+=","+h3.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
ta.append("nn"+melt2+""+t2.getText()+"'sregisternumberis"+t1.getText());
ta.append("n"+melt+"isstudyingin"+yos.getSelectedItem()+" year
"+degree.getSelectedItem()+""+branch.getSelectedItem());
ta.append("n"+melt+"wasbornon"+dob);
ta.append("n"+melt+"isresidingat"+t4.getText());
ta.append("n"+melt1+"E-Mail addressis"+t3.getText());
ta.append("n"+melt+"isinterestedin"+h);
ta.append("n"+melt+"plays"+ptr+"well");
msg="studentdetailsare submitted!";
csg="";
}p.setText(msg);p.setForeground(Color.red);
}
publicvoiditemStateChanged(ItemEvente)
{
if(e.getItemSelectable()==degree)
{
if(((Choice)e.getItemSelectable()).getSelectedItem()=="M.Tech")
{yos.remove("3");
yos.remove("4");}
if(((Choice)e.getItemSelectable()).getSelectedItem()=="B.Tech")
{yos.add("3");
yos.add("4");}
}
}
publicstaticvoidmain(Stringg[])
{student9stu=new student9();
stu.setSize(new Dimension(850,650));
stu.setTitle("ResponseForm");
stu.setVisible(true);
}
}
class myWindowAdapterextendsWindowAdapter
{publicvoidwindowClosing(WindowEventwe)
{
System.exit(0);
}
}
E:javaprograming>javacstudent9.java
E:javaprograming>javastudent9
EXP.NO:-10 LAB EXERCISE:-
NOTE : CONSECUTIVEARITHMETIC OPERATIONSCAN ALSOBE
PERFORMED… EG: 1+2*8-1, 1*2*3/2 , ETC , …
importjava.awt.*;
importjava.awt.event.*;
publicclassMyCal4 extendsFrame implementsActionListener
{
char OP=' ',a3,a2;TextFieldt1;StringStr1="";
inti=0,j,k=5;
Buttonb[]=newButton[24];
double v1=0.0,v2=0.0,a1=0,a4=0,result=0.0,memValue,c,co;
Strings[]={"M+","M-","MC","MR","C","CE","<-","Sqrt","1","2","3","+","4","5","6","-
","7","8","9","*","0",".","=","/"};
publicMyCal4()
{
super("Calculator");
setSize(400,600);
setFont(newFont("SansSerif",Font.BOLD,25));
setBackground(Color.yellow);
setLayout(newBorderLayout(5,5));
t1=newTextField("0",10);
t1.setBackground(Color.green);
t1.setForeground(Color.red);
t1.addActionListener(this);
addWindowListener(newWindowAdapter(){
publicvoidwindowClosing(WindowEvent e) {System.exit(0);}});
add(t1,BorderLayout.NORTH);
Panel p=newPanel();
p.setLayout(newGridLayout(6,4,10,10));
p.setBackground(Color.yellow);
add(p,BorderLayout.CENTER);
for(inti=0;i<24;i++)
{
b[i]=newButton(s[i]);
p.add(b[i]);
b[i].addActionListener(this);
b[i].setBackground(Color.cyan);
}
setVisible(true);
}
publicvoidactionPerformed(ActionEventae)
{
try{
Stringstr=ae.getActionCommand();
if(str.equals("+")||str.equals("-")||str.equals("*")||str.equals("/"))
{
v1=Double.parseDouble(t1.getText());
a4=v1;
a3=OP;
if(a3==' ')
a1=a4;
else if(a3=='+')
a1=a1+a4;
else if(a3=='-')
a1=a1-a4;
else if(a3=='*')
a1=a1*a4;
else
a1=a1/a4;
OP=str.charAt(0);
a2=OP;
t1.setText(Str1="");a3=a2;
}
else if(str.equals("=")||str.equals("M+")||str.equals("M-"))
{
v1=a1;
v2=Double.parseDouble(t1.getText());
if(OP=='+')
{result=v1+v2;a1=0.0;}
else if(OP=='-')
{result=v1-v2;a1=0.0;}
else if(OP=='*')
{result=v1*v2;a1=0.0;}
else if(OP=='/')
{result=v1/v2;a1=0.0;}
else if(OP=='')
result=c;
if(v1==0.0)
result=Double.parseDouble(t1.getText());
if(str.equals("="))
{
t1.setText(""+result);
str=Str1="";v1=v2=0;}
else if(str.equals("M+")||str.equals("M-"))
{
OP=' ';
if(str.equals("M+"))
{memValue+=result;}
else
{memValue-=result;}
c=result;
result=0;
t1.setText("0");str=Str1="";v1=v2=0;}
}
else if(str.equals("CE"))
{
memValue=0;a1=0.0;OP=' ';
t1.setText("0");
str="";
Str1="";
}
else if(str.equals("<-"))
{
StringRes="";
for(inti=0;i<((t1.getText()).length()-1);i++) Res+=((t1.getText()).charAt(i));
if(Res.equals(""))
{t1.setText("0");Str1="";}
else
t1.setText(Str1=Res);
}
else if(str.equals("."))
{
if(t1.getText()=="")
{t1.setText("0.");}
else
{ t1.setText(Str1=t1.getText()+"."); }
}
else if(str.equals("Sqrt"))
{
try
{
double temp=Double.parseDouble(t1.getText());
double tempd=result=Math.sqrt(temp);
StringresText=""+tempd;
resText=""+Double.parseDouble(resText.substring(0,resText.length()-2));
t1.setText(resText);}
catch(ArithmeticExceptionexcp)
{t1.setText("Divide by0.");}
}
else if(str.equals("C"))
{
v2=0.0;OP=' '; memValue=0.0;
t1.setText(""+a1);
}
else if(str.equals("MC"))
{
memValue=0.0;
}
else if(str.equals("MR"))
{
StringresText=""+memValue;
resText=""+Double.parseDouble(resText.substring(0,resText.length()-2));
t1.setText(resText);
}
else
{
t1.setText(Str1.concat(str));
Str1=t1.getText();
}
}catch(Exceptione){}
}
publicstaticvoidmain(Stringa[])
{ newMyCal4();}
publicInsetsgetInsets()
{
returnnewInsets(50,25,25,25);
} }
E:javaprograming>javacMyCal4.java
E:javaprograming>javaMyCal4
EXP.NO:-11 PRELAB EXERCISE:-
importjava.io.*;
classcopyfile
{
publicstaticvoidmain(Stringa[])
{
File in=newFile("hai.txt");
File out=newFile("hh.txt");
FileReaderins=null;
FileWriterouts=null;
try
{
ins=newFileReader(in);
outs=newFileWriter(out);
intch;
while((ch=ins.read())!=-1)
{
outs.write(ch);
}
}
catch(IOExceptione)
{
System.out.println(e);
System.exit(-1);
}
finally
{
try
{
ins.close();
outs.close();
}
catch(IOExceptione){}
}
} }
E:javaprograming>javaccopyfile.java
E:javaprograming>javacopyfile
EXP.NO:-11 LAB EXERCISE:-
importjava.io.*;importjava.io.File.*;
importjava.awt.*;
importjava.applet.*;
importjava.awt.event.*;
publicclassstudent1extendsFrame implementsActionListener,ItemListener
{
Stringmsg="",taa="";inti;Choice c[]=new Choice[3];
List lst=newList(4,true);
Label l[]=newLabel[16];booleanisnumberornot;
Stringlcap[]={"RegisterNo.","Name","Sex","Degree","Branch","Yearof Study","Date of
Birth","Hobby","Address","ExtraCurricularActivities","E-Mail Id","B.Tech","M.Tech","CSE","ECE","EEE"};
Buttonb1=new Button("submit");
Buttonb2=newButton("cancel");Checkboxh1,h2,h3;
Label p=newLabel("",Label.CENTER);
Label l11=newLabel("StudentResponse Form",Label.CENTER);
Label l7=newLabel("",Label.RIGHT);
TextFieldt1=newTextField(20);
TextFieldt2=newTextField(20);
TextFieldt3=newTextField(20);
TextAreata=newTextArea("",100,100,TextArea.SCROLLBARS_BOTH);
CheckboxGroupcbg=newCheckboxGroup();
Checkbox ck1=newCheckbox("Male",false,cbg);
Checkbox ck2=newCheckbox("Female",false,cbg);
TextAreat5=newTextArea("",180,90,TextArea.SCROLLBARS_VERTICAL_ONLY);
Choice branch=newChoice();
Choice degree=newChoice();
Choice yos=newChoice();RandomAccessFile pol=null;
publicstudent1()
{
for(i=0;i<7;i++)
{l[i]=newLabel(lcap[i],Label.LEFT);add(l[i]);}
for(i=7;i<11;i++)
{l[i]=newLabel(lcap[i],Label.CENTER);add(l[i]);}
for(i=0;i<3;i++)
{ c[i]=newChoice();add(c[i]);}
add(p);
h1=newCheckbox("StampCollection");
h2=newCheckbox("ReadingNovels");
h3=newCheckbox("PlayingTennis");
addWindowListener(newmyWindowAdapter());
setBackground(Color.cyan);
setForeground(Color.black);
setLayout(null);
add(l11);
lst.add("Tennis");lst.add("Cricket");lst.add("BasketBall");lst.add("Hockey");
add(ta);add(h1);add(h2);add(h3);add(lst);
add(t1); add(t2); add(t3); add(ck1); add(ck2); add(branch); add(degree); add(yos);
add(b1); b1.addActionListener(this);b2.addActionListener(this); add(b2);
degree.add(lcap[11]);degree.add(lcap[12]);
for(i=13;i<16;i++)
branch.add(lcap[i]);
yos.add("1"); yos.add("2"); yos.add("3");yos.add("4");
l11.setFont(newFont("SansSerif",Font.BOLD+Font.ITALIC,15));
p.setFont(new Font("SansSerif",Font.BOLD+Font.ITALIC,15));
for(inti=1;i<=31;i++)
c[0].add(""+i);
degree.addItemListener(this);
c[1].add("January");c[1].add("February");c[1].add("March");
c[1].add("April");c[1].add("May");c[1].add("June");c[1].add("July");c[1].add("August");
c[1].add("September");c[1].add("October");c[1].add("November");c[1].add("December");
for(i=1990;i<2002;i++)
c[2].add(""+i);
for(i=0;i<6;i++)
l[i].setBounds(25,(60+(i*30)),90,20);
l[6].setBounds(25,320,90,20); l[7].setBounds(425,65,100,20);
l[8].setBounds(431,105,100,20); l[9].setBounds(632,105,150,20); l[10].setBounds(433,320,100,20);
l11.setBounds(300,40,280,20); lst.setBounds(642,125,130,89);
t1.setBounds(120,60,170,20); t2.setBounds(120,90,170,20); t3.setBounds(538,320,170,20);
ta.setBounds(461,125,130,90); ck1.setBounds(120,120,50,20); ck2.setBounds(170,120,60,20);
degree.setBounds(120,150,70,20); branch.setBounds(120,180,50,20); yos.setBounds(120,210,30,20);
c[0].setBounds(120,320,35,20); c[1].setBounds(160,320,77,20); c[2].setBounds(243,320,50,20);
h1.setBounds(530,65,105,20); h2.setBounds(644,65,100,20); h3.setBounds(750,65,100,20);
p.setBounds(120,420,530,20); b1.setBounds(300,380,65,20); b2.setBounds(400,380,65,20);
}
publicvoidactionPerformed(ActionEventae)
{if(ae.getActionCommand().equals("submit"))
{
if(t1.getText().length()!=9)
{
msg="registernumbershouldbe 9characters!";
}
else
{
try{
intkk=Integer.parseInt(t1.getText());isnumberornot=false;
}
catch(Exceptione)
{
isnumberornot=true;
}
if(isnumberornot)
{
msg="Charactersshouldbe avoidedforRegNo";
}
else
{
msg="";booleanisEmpty=t2.getText()==null||t2.getText().trim().length()==0;
if(isEmpty)
{
msg="Name shouldnotbe blank";
}
else
{
if(cbg.getSelectedCheckbox()==null)
{
msg="Selectthe Gender";
}
else
{
msg="";isEmpty=ta.getText()==null||ta.getText().trim().length()==0;
if(isEmpty)
{
msg="Addressshouldnotbe blank";
}
else
{
msg="";intyo=t3.getText().lastIndexOf("@");
if(!t3.getText().endsWith("@gmail.com"))
{
msg="InvalidE-Mail ID(@gmail.comnotfound)";
}
else
{
Stringjo=(t3.getText()).substring(0,yo);
isEmpty=jo==null||jo.trim().length()==0||jo.startsWith("");
if(isEmpty)
{
msg="InvalidE-Mail Id(charactersisnotpresentbefore@ORfirstletterisnull)";
}
else
{
Stringdob,ptr="",pho[],h="";
pho=lst.getSelectedItems();
for(inti=0;i<pho.length;i++)
{ptr+=pho[i];if(i!=pho.length-1){ptr+=",";}}
dob=c[0].getSelectedItem()+"-"+c[1].getSelectedItem()+"-"+c[2].getSelectedItem();
if(h1.getState()){h+=h1.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
if(h2.getState()){h+=","+h2.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
if(h3.getState()){h+=","+h3.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
taa="rnRegisterNo:"+t1.getText()
+"rnName :"+t2.getText()
+"rnSex :"+cbg.getSelectedCheckbox().getLabel()
+"rnDegree :"+degree.getSelectedItem()
+"rnBranch:"+branch.getSelectedItem()
+"rnYearOf Study:"+yos.getSelectedItem()
+"rnD.O.B:"+dob
+"rnHobbies:"+h
+"rnExtraCurricularActivities:"+ptr
+"rnAddress:"+ta.getText()
+"rnE-Mail Id:"+t3.getText();
msg="studentdetailsare submitted!";
} } } } } } }
try
{
pol=newRandomAccessFile("stud.txt","rw");
//newRandomAccessFile("stud.txt","rw").setLength(0);//clearsthe entirefilecontentandappend
pol.seek(pol.length());pol.writeBytes(taa+"rn");//withoutusingabove statement,appendingrecords
//continuously
pol.close();
taa="";
}
catch(Exceptione){}
}
if(ae.getActionCommand().equals("cancel"))
{
if(degree.getSelectedItem().equals("M.Tech")){yos.add("3");yos.add("4");}
t1.setText("");t2.setText("");t3.setText("");ta.setText("");
cbg.setSelectedCheckbox(null);h1.setState(false);h2.setState(false);h3.setState(false);
lst.deselect(0);lst.deselect(1);lst.deselect(2);lst.deselect(3);msg="";
degree.select(0);branch.select(0);c[0].select(0);c[1].select(0);c[2].select(0);
yos.select(0);
}
p.setText(msg);
p.setForeground(Color.red);
}
publicvoiditemStateChanged(ItemEvente)
{
if(e.getItemSelectable()==degree)
{
if(((Choice)e.getItemSelectable()).getSelectedItem()=="M.Tech")
{yos.remove("3"); yos.remove("4");}
if(((Choice)e.getItemSelectable()).getSelectedItem()=="B.Tech")
{yos.add("3"); yos.add("4");}
} }
publicstaticvoidmain(Stringg[])
{student1stu=newstudent1();
stu.setSize(new Dimension(900,500));
stu.setTitle("ResponseForm");
stu.setVisible(true);
} }
class myWindowAdapterextendsWindowAdapter
{publicvoidwindowClosing(WindowEventwe)
{ System.exit(0);
} }
E:javaprograming>javacstudent1.java
E:javaprograming>javastudent1
EXP.NO:-12 PRELAB EXERCISE:-
importjava.awt.*; importjava.sql.*; importjava.awt.event.*;
classsampjdbcextendsFrame implementsActionListener
{
Label l1,l2; TextFieldt1,t2; Buttonb; Connectionc; Statementst; ResultSetrs;
sampjdbc()
{
setFont(newFont("Arial",Font.BOLD,20));
l1 = newLabel("Login");
l2 = newLabel("Password");
t1= newTextField(10);
t2 =newTextField(10);
b= newButton("Next");
addWindowListener(newWindowAdapter(){
publicvoidwindowClosing(WindowEvente) {System.exit(0);}});
setLayout(newGridLayout(3,2));
add(l1);add(l2);add(t1);add(t2);add(b);
b.addActionListener(this);
try
{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
Statementst=c.createStatement();
//Connection c=DriverManager.getConnection("jdbc:derby:cse;create=true");
c=DriverManager.getConnection("jdbc:derby:cse");
//st.execute("createtable stu(name char(20),idint)");
//st.execute("insertintostuvalues('ccc',333)");
//st.execute("insertintostuvalues('ddd',444)");
rs=st.executeQuery("select*fromstu");
}catch(Exceptione){}
}
publicvoidactionPerformed(ActionEventae)
{
try
{
if(rs.next())
{
t1.setText(rs.getString(1));
t2.setText(String.valueOf((rs.getInt(2))));
}
}catch(Exceptione){}
}
publicstaticvoidmain(Stringargs[])
{
sampjdbcj=newsampjdbc();
j.setTitle("StudentDB");
j.setSize(210,150);j.setBackground(Color.cyan);
j.setVisible(true);
} }
E:javaprograming>javacsampjdbc.java
E:javaprograming>javasampjdbc
EXP.NO:-12 LAB EXERCISE:-
importjava.sql.*; importjava.awt.*; importjava.applet.*; importjava.awt.event.*;
publicclassstudent6extendsFrame implementsActionListener,ItemListener
{
Stringmsg="";inti;Choice c[]=newChoice[3];
List lst=new List(4,true);intsar=0,moi=0,soi=0,tit,kiy,rows;
Label l[]=newLabel[16];
Stringlcap[]={"RegisterNo.","Name","Sex","Degree","Branch","Yearof Study","Date of
Birth","Hobby","Address","ExtraCurricularActivities","E-Mail Id","B.Tech","M.Tech","CSE","ECE","EEE"};
Stringlo[]={"ADD","SEARCH","DELETE","<<","<",">",">>","UPDATE","CLEAR"};
Checkbox h1,h2,h3;
Label p=newLabel("",Label.CENTER);booleanisnumberornot;
Label l11=newLabel("StudentResponse Form",Label.CENTER);
Label l7=newLabel("",Label.RIGHT);
TextFieldt1=newTextField(20);
TextFieldt2=newTextField(20);
TextFieldt3=newTextField(20);
Buttonb[]=newButton[9];
TextAreata=newTextArea("",100,100,TextArea.SCROLLBARS_BOTH);
CheckboxGroupcbg=newCheckboxGroup();
Checkbox ck1=newCheckbox("Male",false,cbg);
Checkbox ck2=newCheckbox("Female",false,cbg);
TextAreat5=newTextArea("",180,90,TextArea.SCROLLBARS_VERTICAL_ONLY);
Choice branch=newChoice();
Choice degree=newChoice();
Choice yos=newChoice();
Connectionco; Statementst; ResultSetrs; PreparedStatementq;
publicstudent6()
{
for(i=0;i<7;i++)
{l[i]=newLabel(lcap[i],Label.LEFT);add(l[i]);}
for(i=7;i<11;i++)
{l[i]=newLabel(lcap[i],Label.CENTER);add(l[i]);}
for(i=0;i<3;i++)
{ c[i]=newChoice();add(c[i]);}
add(p);
h1=newCheckbox("StampCollection");
h2=newCheckbox("ReadingNovels");
h3=newCheckbox("PlayingTennis");
addWindowListener(newmyWindowAdapter());
setBackground(Color.cyan);
setForeground(Color.black);
setLayout(null);
add(l11);
lst.add("Tennis");
lst.add("Cricket");lst.add("BasketBall");lst.add("Hockey");lst.add("VolleyBall");
add(ta);add(h1);add(h2);add(h3);add(lst); add(t1);
add(t2); add(t3); add(ck1); add(ck2); add(branch); add(degree);add(yos);
for(i=0;i<9;i++)
{b[i]=new Button(lo[i]);add(b[i]);b[i].addActionListener(this);}
degree.add(lcap[11]);
degree.add(lcap[12]);
for(i=13;i<16;i++)
branch.add(lcap[i]);
yos.add("1"); yos.add("2"); yos.add("3"); yos.add("4");
l11.setFont(newFont("SansSerif",Font.BOLD+Font.ITALIC,15));
p.setFont(new Font("SansSerif",Font.BOLD+Font.ITALIC,15));
for(inti=1;i<=31;i++)
c[0].add(""+i);
degree.addItemListener(this);
c[1].add("January");c[1].add("February");c[1].add("March");c[1].add("April");
c[1].add("May");c[1].add("June");c[1].add("July");c[1].add("August");c[1].add("September");
c[1].add("October");c[1].add("November");c[1].add("December");
for(i=1990;i<2002;i++)
c[2].add(""+i);
for(i=0;i<6;i++)
l[i].setBounds(25,(60+(i*30)),90,20);
l[6].setBounds(25,320,90,20); l[7].setBounds(425,65,100,20);
l[8].setBounds(431,105,100,20); l[9].setBounds(632,105,150,20); l[10].setBounds(433,320,100,20);
l11.setBounds(300,40,280,20);lst.setBounds(642,125,130,59); t1.setBounds(120,60,170,20);
t2.setBounds(120,90,170,20); t3.setBounds(538,320,170,20); ta.setBounds(461,125,130,60);
ck1.setBounds(120,120,50,20); ck2.setBounds(170,120,60,20); degree.setBounds(120,150,70,20);
branch.setBounds(120,180,50,20); yos.setBounds(120,210,30,20); c[0].setBounds(120,320,35,20);
c[1].setBounds(160,320,77,20); c[2].setBounds(243,320,50,20); h1.setBounds(530,65,105,20);
h2.setBounds(644,65,100,20); h3.setBounds(750,65,100,20); p.setBounds(120,420,530,20);
b[0].setBounds(145,380,50,20); b[1].setBounds(213,380,70,20); b[2].setBounds(300,380,70,20);
b[3].setBounds(385,380,35,20); b[4].setBounds(435,380,20,20); b[5].setBounds(465,380,20,20);
b[6].setBounds(505,380,35,20); b[7].setBounds(555,380,70,20); b[8].setBounds(420,440,70,20);
try
{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
//co=DriverManager.getConnection("jdbc:derby:csel;create=true");
co=DriverManager.getConnection("jdbc:derby:csel");
st=co.createStatement();
//st.execute("createtable human(RNOinteger,Name varchar(40),Genderchar(8),Degree char(20),
Branch char(20), YearOfStudyinteger,DOBdate,Addressvarchar(1000),EMailIdvarchar(60),Hobby
char(160), ECA char(160))");
//st.execute("insertintohumanvalues(221003116,'photons','Male','B.Tech','CSE',2,'1999-10-
19','Papanasam','karuppaiyaa4139@gmail.com','ReadingNovels','Tennis')");
st=co.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs=st.executeQuery("select*from human");
if(rs.first()){display();sar=1;}
rs=st.executeQuery("select*from human");
q=co.prepareStatement("insertintohumanvalues(?,?,?,?,?,?,?,?,?,?,?)");
}catch(Exceptione){ e.printStackTrace();}
}
publicvoidreset()
{ if(degree.getSelectedItem().equals("M.Tech")){yos.add("3");yos.add("4");}
t2.setText("");t3.setText("");ta.setText("");
cbg.setSelectedCheckbox(null);h1.setState(false);h2.setState(false);h3.setState(false);
lst.deselect(4);lst.deselect(3);lst.deselect(2);lst.deselect(1);lst.deselect(0);
degree.select(0);branch.select(0);c[0].select(0);c[1].select(0);c[2].select(0);
yos.select(0);
}
publicvoidactionPerformed(ActionEventae)
{
try{
if(ae.getActionCommand().equals("ADD"))
{
if(t1.getText().length()!=9)
{
msg="registernumbershouldbe 9characters!";
}
else
{
try{
intkk=Integer.parseInt(t1.getText());isnumberornot=false;
}
catch(Exceptione)
{
isnumberornot=true;
}
if(isnumberornot)
{
msg="Charactersshouldbe avoidedforRegNo";
}
else
{
msg="";booleanisEmpty=t2.getText()==null||t2.getText().trim().length()==0;
if(isEmpty)
{
msg="Name shouldnotbe blank";
}
else
{
if(cbg.getSelectedCheckbox()==null)
{
msg="Selectthe Gender";
}
else
{
msg="";isEmpty=ta.getText()==null||ta.getText().trim().length()==0;
if(isEmpty)
{
msg="Addressshouldnotbe blank";
}
else
{
msg="";intyo=t3.getText().lastIndexOf("@");
if(!t3.getText().endsWith("@gmail.com"))
{
msg="InvalidE-Mail ID(@gmail.comnotfound)";
}
else
{
Stringjo=(t3.getText()).substring(0,yo);
isEmpty=jo==null||jo.trim().length()==0||jo.startsWith("");
if(isEmpty)
{
msg="InvalidE-Mail Id(charactersisnotpresentbefore@ORfirstletterisnull)";
}
else
{
rs=st.executeQuery("select*from human");
while(rs.next())
{
if((String.valueOf(rs.getInt(1))).equals(t1.getText())){msg="ERROR,RegNoisalreadypresentin
the record!";moi=1;}
}
if(moi!=1)
{
Stringdob,ptr="",bod="",good="",pho[],h="";
for(inttt=0;tt<12;tt++)
{
if(c[1].getSelectedIndex()==tt)
{if(tt<9)good="0"+(tt+1);
else{good=""+(tt+1);}
} }
pho=lst.getSelectedItems();
for(inti=0;i<pho.length;i++)
{ptr+=pho[i];if(i!=pho.length-1){ptr+=",";}}
dob=c[0].getSelectedItem()+"-"+c[1].getSelectedItem()+"-"+c[2].getSelectedItem();
bod=c[2].getSelectedItem()+"-"+good+"-"+c[0].getSelectedItem();
if(h1.getState()){h+=h1.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
if(h2.getState()){h+=","+h2.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
if(h3.getState()){h+=","+h3.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
msg="studentdetailsare added!";
q.setInt(1,Integer.parseInt(t1.getText()));
q.setString(2,t2.getText());
q.setString(3,cbg.getSelectedCheckbox().getLabel());
q.setString(4,degree.getSelectedItem());
q.setString(5,branch.getSelectedItem());
q.setInt(6,Integer.parseInt(yos.getSelectedItem()));
q.setString(7,bod);
q.setString(8,ta.getText());
q.setString(9,t3.getText());
q.setString(10,h);
q.setString(11,ptr);
q.executeUpdate();
rs=st.executeQuery("select*from human");rs.last();
} }moi=0;} } } } } } }
if(ae.getActionCommand().equals("SEARCH"))
{
rs=st.executeQuery("select*from human");
while(rs.next())
{
if((String.valueOf(rs.getInt(1))).equals(t1.getText())){display();msg="studentdetail is
searched!";break;}
else{
msg="EntervalidRegNo!";reset();
} } }
if(ae.getActionCommand().equals("CLEAR"))
{
msg="studentdetails are cleared!";reset();t1.setText("");
}
if(ae.getActionCommand().equals("DELETE"))
{
rs=st.executeQuery("select*from human");
while(rs.next())
{
if((String.valueOf(rs.getInt(1))).equals(t1.getText()))
{
Stringfrog="delete fromhumanwhere RNO="+t1.getText()+"";
st.executeUpdate(frog);
msg="studentdetailsare deleted!";reset();
rs=st.executeQuery("select*from human");
break; }
else{
msg="EntervalidRegNo!";reset();}
}
}
if(ae.getActionCommand().equals("<<"))
{
if(rs.first()) display();
msg="Firststudentrecord!";}
if(ae.getActionCommand().equals("<"))
{
if(rs.previous())
{display();
msg="Previousstudentrecord!";}
else
msg="YouHad ReachedThe Firstrecord!";
}
if(ae.getActionCommand().equals(">"))
{
if(rs.next())
{display();
if(sar==1){msg="Thisisfirststudentrecord!";sar=0;}
else
{msg="Nextstudentrecord!";}
}else
{msg="YouHad ReachedThe Last record!";}
}
if(ae.getActionCommand().equals(">>"))
{
if(rs.last()) display();
msg="Last studentrecord!";}
if(ae.getActionCommand().equals("UPDATE"))
{
rs=st.executeQuery("select*from human");
while(rs.next())
{tit=rs.getRow();
if((String.valueOf(rs.getInt(1))).equals(t1.getText()))
{soi=1;
if(t1.getText().length()!=9)
{
msg="registernumbershouldbe 9characters!";
}
else
{
try{
intkk=Integer.parseInt(t1.getText());isnumberornot=false;
}
catch(Exceptione)
{
isnumberornot=true;
}
if(isnumberornot)
{
msg="Charactersshouldbe avoidedforRegNo";
}
else
{
msg="";boolean isEmpty=t2.getText()==null||t2.getText().trim().length()==0;
if(isEmpty)
{
msg="Name shouldnotbe blank";
}
else
{
if(cbg.getSelectedCheckbox()==null)
{
msg="Selectthe Gender";
}
else
{
msg="";isEmpty=ta.getText()==null||ta.getText().trim().length()==0;
if(isEmpty)
{
msg="Addressshouldnotbe blank";
}
else
{
msg="";intyo=t3.getText().lastIndexOf("@");
if(!t3.getText().endsWith("@gmail.com"))
{
msg="InvalidE-Mail ID(@gmail.comnotfound)";
}
else
{
Stringjo=(t3.getText()).substring(0,yo);
isEmpty=jo==null||jo.trim().length()==0||jo.startsWith("");
if(isEmpty)
{
msg="InvalidE-Mail Id(charactersisnotpresentbefore@ORfirstletterisnull)";
}
else
{
Stringdob,ptr="",bod="",good="",pho[],h="";
for(inttt=0;tt<12;tt++)
{
if(c[1].getSelectedIndex()==tt)
{if(tt<9)good="0"+(tt+1);
else{good=""+(tt+1);}
} }
pho=lst.getSelectedItems();
for(inti=0;i<pho.length;i++)
{ptr+=pho[i];if(i!=pho.length-1){ptr+=",";}}
dob=c[0].getSelectedItem()+"-"+c[1].getSelectedItem()+"-"+c[2].getSelectedItem();
bod=c[2].getSelectedItem()+"-"+good+"-"+c[0].getSelectedItem();
if(h1.getState()){h+=h1.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
if(h2.getState()){h+=","+h2.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
if(h3.getState()){h+=","+h3.getLabel();if(h.charAt(0)==',')h=h.substring(1,h.length());}
rs.absolute(tit);rs.updateInt(1,Integer.parseInt(t1.getText()));
rs.updateString(2,t2.getText());
rs.updateString(3,cbg.getSelectedCheckbox().getLabel());
rs.updateString(4,degree.getSelectedItem());
rs.updateString(5,branch.getSelectedItem());
rs.updateInt(6,Integer.parseInt(yos.getSelectedItem()));
rs.updateString(7,bod);
rs.updateString(8,ta.getText());
rs.updateString(9,t3.getText());
rs.updateString(10,h);
rs.updateString(11,ptr);
rs.updateRow();msg="studentdetailsare updated!";
}moi=0;
} } } } } } break; } }
if(soi!=1)msg="RegNoisunavailableinthe record";
}
p.setText(msg);
p.setForeground(Color.red);
}catch(Exceptione){e.printStackTrace();}
}
publicvoiditemStateChanged(ItemEvente)
{
if(e.getItemSelectable()==degree)
{
if(((Choice)e.getItemSelectable()).getSelectedItem()=="M.Tech")
{yos.remove("3"); yos.remove("4");}
if(((Choice)e.getItemSelectable()).getSelectedItem()=="B.Tech")
{yos.add("3"); yos.add("4");}
} }
publicvoiddisplay()
{
try{
t1.setText(String.valueOf((rs.getInt(1))));
t2.setText(rs.getString(2));
Stringsds=rs.getString(3).trim();
if(sds.equals("Male"))ck1.setState(true);
if(sds.equals("Female"))ck2.setState(true);
degree.select(rs.getString(4));
branch.select(rs.getString(5));
yos.select(rs.getString(6));
Stringuu=rs.getString(7);
Stringgh=uu.substring(8,10);
if(gh.charAt(0)=='0')gh=gh.substring(1,2);
c[0].select(gh);
gh=uu.substring(5,7);
if(gh.charAt(0)=='0')gh=gh.substring(1,2);
c[1].select((Integer.parseInt(gh)-1));
c[2].select(uu.substring(0,uu.indexOf("-")));
ta.setText(rs.getString(8));
t3.setText(rs.getString(9));
h1.setState(false);h2.setState(false);h3.setState(false);
lst.deselect(4);lst.deselect(3);lst.deselect(2);lst.deselect(1);lst.deselect(0);
Stringhhp=rs.getString(10);
for(intzz=0;zz<47;zz++)
{
if(hhp.charAt(zz)=='S')h1.setState(true);
if(hhp.charAt(zz)=='R')h2.setState(true);
if(hhp.charAt(zz)=='P')h3.setState(true);
}
hhp=rs.getString(11);
for(intzz=0;zz<47;zz++)
{
if(hhp.charAt(zz)=='T')lst.select(0);
if(hhp.charAt(zz)=='C')lst.select(1);
if(hhp.charAt(zz)=='B')lst.select(2);
if(hhp.charAt(zz)=='H')lst.select(3);
if(hhp.charAt(zz)=='V')lst.select(4);
}
}
catch(Exceptione){e.printStackTrace();}
}
publicstaticvoidmain(Stringg[])
{student6stu=newstudent6();
stu.setSize(new Dimension(900,500));
stu.setTitle("ResponseForm");
stu.setVisible(true);
} }
class myWindowAdapterextendsWindowAdapter
{publicvoidwindowClosing(WindowEventwe)
{
System.exit(0);
} }
E:javaprograming>javacstudent6.java
E:javaprograming>javastudent6

Weitere ähnliche Inhalte

Was ist angesagt?

The Ring programming language version 1.4.1 book - Part 18 of 31
The Ring programming language version 1.4.1 book - Part 18 of 31The Ring programming language version 1.4.1 book - Part 18 of 31
The Ring programming language version 1.4.1 book - Part 18 of 31Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 30 of 184
The Ring programming language version 1.5.3 book - Part 30 of 184The Ring programming language version 1.5.3 book - Part 30 of 184
The Ring programming language version 1.5.3 book - Part 30 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 30 of 185
The Ring programming language version 1.5.4 book - Part 30 of 185The Ring programming language version 1.5.4 book - Part 30 of 185
The Ring programming language version 1.5.4 book - Part 30 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 39 of 212
The Ring programming language version 1.10 book - Part 39 of 212The Ring programming language version 1.10 book - Part 39 of 212
The Ring programming language version 1.10 book - Part 39 of 212Mahmoud Samir Fayed
 
Nosql hands on handout 04
Nosql hands on handout 04Nosql hands on handout 04
Nosql hands on handout 04Krishna Sankar
 
The Ring programming language version 1.2 book - Part 22 of 84
The Ring programming language version 1.2 book - Part 22 of 84The Ring programming language version 1.2 book - Part 22 of 84
The Ring programming language version 1.2 book - Part 22 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88Mahmoud Samir Fayed
 
WorkingWithSlick2.1.0
WorkingWithSlick2.1.0WorkingWithSlick2.1.0
WorkingWithSlick2.1.0Knoldus Inc.
 
The Ring programming language version 1.9 book - Part 46 of 210
The Ring programming language version 1.9 book - Part 46 of 210The Ring programming language version 1.9 book - Part 46 of 210
The Ring programming language version 1.9 book - Part 46 of 210Mahmoud Samir Fayed
 
D3 svg & angular
D3 svg & angularD3 svg & angular
D3 svg & angular500Tech
 
The Ring programming language version 1.5.2 book - Part 32 of 181
The Ring programming language version 1.5.2 book - Part 32 of 181The Ring programming language version 1.5.2 book - Part 32 of 181
The Ring programming language version 1.5.2 book - Part 32 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 43 of 180
The Ring programming language version 1.5.1 book - Part 43 of 180The Ring programming language version 1.5.1 book - Part 43 of 180
The Ring programming language version 1.5.1 book - Part 43 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 43 of 202
The Ring programming language version 1.8 book - Part 43 of 202The Ring programming language version 1.8 book - Part 43 of 202
The Ring programming language version 1.8 book - Part 43 of 202Mahmoud Samir Fayed
 

Was ist angesagt? (20)

The Ring programming language version 1.4.1 book - Part 18 of 31
The Ring programming language version 1.4.1 book - Part 18 of 31The Ring programming language version 1.4.1 book - Part 18 of 31
The Ring programming language version 1.4.1 book - Part 18 of 31
 
The Ring programming language version 1.5.3 book - Part 30 of 184
The Ring programming language version 1.5.3 book - Part 30 of 184The Ring programming language version 1.5.3 book - Part 30 of 184
The Ring programming language version 1.5.3 book - Part 30 of 184
 
Ds 2 cycle
Ds 2 cycleDs 2 cycle
Ds 2 cycle
 
mobl
moblmobl
mobl
 
The Ring programming language version 1.5.4 book - Part 30 of 185
The Ring programming language version 1.5.4 book - Part 30 of 185The Ring programming language version 1.5.4 book - Part 30 of 185
The Ring programming language version 1.5.4 book - Part 30 of 185
 
The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212
 
D3.js workshop
D3.js workshopD3.js workshop
D3.js workshop
 
The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210
 
The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84
 
The Ring programming language version 1.10 book - Part 39 of 212
The Ring programming language version 1.10 book - Part 39 of 212The Ring programming language version 1.10 book - Part 39 of 212
The Ring programming language version 1.10 book - Part 39 of 212
 
Nosql hands on handout 04
Nosql hands on handout 04Nosql hands on handout 04
Nosql hands on handout 04
 
The Ring programming language version 1.2 book - Part 22 of 84
The Ring programming language version 1.2 book - Part 22 of 84The Ring programming language version 1.2 book - Part 22 of 84
The Ring programming language version 1.2 book - Part 22 of 84
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88
 
WorkingWithSlick2.1.0
WorkingWithSlick2.1.0WorkingWithSlick2.1.0
WorkingWithSlick2.1.0
 
The Ring programming language version 1.9 book - Part 46 of 210
The Ring programming language version 1.9 book - Part 46 of 210The Ring programming language version 1.9 book - Part 46 of 210
The Ring programming language version 1.9 book - Part 46 of 210
 
D3 svg & angular
D3 svg & angularD3 svg & angular
D3 svg & angular
 
The Ring programming language version 1.5.2 book - Part 32 of 181
The Ring programming language version 1.5.2 book - Part 32 of 181The Ring programming language version 1.5.2 book - Part 32 of 181
The Ring programming language version 1.5.2 book - Part 32 of 181
 
The Ring programming language version 1.5.1 book - Part 43 of 180
The Ring programming language version 1.5.1 book - Part 43 of 180The Ring programming language version 1.5.1 book - Part 43 of 180
The Ring programming language version 1.5.1 book - Part 43 of 180
 
Typelevel summit
Typelevel summitTypelevel summit
Typelevel summit
 
The Ring programming language version 1.8 book - Part 43 of 202
The Ring programming language version 1.8 book - Part 43 of 202The Ring programming language version 1.8 book - Part 43 of 202
The Ring programming language version 1.8 book - Part 43 of 202
 

Ähnlich wie java experiments and programs

Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple ProgramsUpender Upr
 
Java programs
Java programsJava programs
Java programsjojeph
 
20160616技術會議
20160616技術會議20160616技術會議
20160616技術會議Jason Kuan
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Nishan Barot
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql JOYITAKUNDU1
 
I dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfI dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfarchanaemporium
 
Advanced Java - Practical File
Advanced Java - Practical FileAdvanced Java - Practical File
Advanced Java - Practical FileFahad Shaikh
 
Basic program in java
Basic program in java Basic program in java
Basic program in java Sudeep Singh
 
Quest 1 define a class batsman with the following specifications
Quest  1 define a class batsman with the following specificationsQuest  1 define a class batsman with the following specifications
Quest 1 define a class batsman with the following specificationsrajkumari873
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
 

Ähnlich wie java experiments and programs (20)

Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
Java Program
Java ProgramJava Program
Java Program
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
Java programs
Java programsJava programs
Java programs
 
Dotnet 18
Dotnet 18Dotnet 18
Dotnet 18
 
20160616技術會議
20160616技術會議20160616技術會議
20160616技術會議
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
I dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfI dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdf
 
Advanced Java - Practical File
Advanced Java - Practical FileAdvanced Java - Practical File
Advanced Java - Practical File
 
662305 09
662305 09662305 09
662305 09
 
Basic program in java
Basic program in java Basic program in java
Basic program in java
 
java-programming.pdf
java-programming.pdfjava-programming.pdf
java-programming.pdf
 
JAVA.pdf
JAVA.pdfJAVA.pdf
JAVA.pdf
 
Quest 1 define a class batsman with the following specifications
Quest  1 define a class batsman with the following specificationsQuest  1 define a class batsman with the following specifications
Quest 1 define a class batsman with the following specifications
 
.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 

Kürzlich hochgeladen (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 

java experiments and programs