Posts

Showing posts with the label Especially for ICSE students

Implementing Queue In Java

import java.util.*; class arrayQueue {     protected int Queue[] ;     protected int front, rear, size, len;     //Constructor     public arrayQueue(int n)     {         size = n;         len = 0;         Queue = new int[size];         front = -1;         rear = -1;     }       //Function to check if queue is empty     public boolean isEmpty()     {         return front == -1;     }       //Function to check if queue is full     public boolean isFull()     {         return front==0 && rear == size -1 ;     }       //Function to get the size of the queue     public int getSize()     {         return len ;  ...

Anagrams In Java ISC ICSE CBSE Class 12

import java.util.*; class Anagram{     public static void main(){         String s;         Scanner sc=new Scanner(System.in);         System.out.println("Enter a word");         s=sc.next();         Anagram ob=new Anagram();         ob.display("",s);     }     public void display(String p,String w){         if(w.length()<=1)         System.out.println(p+w);         else{             for(int i=0;i<w.length();i++){             String a=w.substring(i,i+1);             String b=w.substring(0,i);             String c=w.substring(i+1);             display(p+a,b+c);         }     } ...

Encoding In Java ISC CBSE Class 12

import java.util.*; class Encode{     public static void main(){         Scanner sc=new Scanner(System.in);         String s,t="",str="",p;         int c,k,l;         System.out.println("Enter the code");         s=sc.next();         l=s.length();         if(l>200){             System.out.println("Invalid Code");             return;         }         for(int i=l-1;i>=0;i--){             c=s.charAt(i)-48;             c=9-c;             t=t+Integer.toString(c);         }         for(int j=0;j<=l;j+=2){             p=t.substring(j,j+2);       ...

Decoding In Java ISC CBSE Class 12

import java.util.*; class Decode{     public static void main(){         Scanner sc=new Scanner(System.in);         String str,s="";         int i,l,j,ss,r,sr=0;         System.out.println("Enter a sentence");         str=sc.nextLine();         l=str.length();         for(j=0;j<l;j++){                 if((str.charAt(j)>=65&&str.charAt(j)<=90)||(str.charAt(j)>=97&&str.charAt(j)<=122)||(str.charAt(j)==32)){                    s=s+(int)str.charAt(j);                 }//if             }//for j             ss=Integer.parseInt(s);             while(ss>0){       ...

Denomination Of Notes Currency In Java Isc Icse CBSE

import java.util.*; class Denomination{     public static void main(){      Scanner sc=new Scanner(System.in);      int n,nn,c=0,s=0,i;      int a[]={1000,500,100,50,20,10,5,2,1};         System.out.println("Enter a multidigit no.");          n=sc.nextInt();          nn=n;          if((n+"").length()>5){              System.exit(1);             }             else{             for(i=0;i<=8;i++){                 c=n/a[i];                 if(c!=0){                 System.out.println(a[i]+"  *  "+c+"      "+a[i]*c);           ...

Integer To Roman In Java ISC CBSE Class 12

class Roman{     public void accept(int n){      int c=0,i,j;      int a[]={1000,900,500,400,100,90,50,40,10,9,5,4,1};      String aa[]={"M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"};          if(n>9999){              System.exit(1);             }             else{             for(i=0;i<=12;i++){                 c=n/a[i];                 if(c!=0){                 for(j=1;j<=c;j++)                 System.out.print(aa[i]);             }                 n=n%a[i];             }     ...

A DOCTOR'S JOURNAL ENTRY FOR AUGUST 6,1945(SUMMARY)

   A DOCTOR'S JOURNAL  ENTRY  FOR AUGUST 6,1945(SUMMARY)    Vikram Seth's poem is a dramatic monologue which outlines the impact of the dropping of the atom bomb on the city of Hiroshima,as seen through the eyes of a Japanese doctor that day.Obviously the poem is anti-war and criticises such an inhuman attack that almost destroyed the city and took tens of thosands of lives.War is a inhuman and brutal thing.It results in destruction and suffering.The images created in the poem stir the feelings of the reader.    A rather surprising thing is Vikram Seth's choice of the subject of his poem.This incident occured much before his life time and thousand's of miles away from his homeland(India).But that Seth should have chosen this incident proves that war and its impact is not limited to national boundaries.War is and will always remain a universal disaster.    The speaker is a Japanese doctor who is relaxing in his home on...