Today we'll deal with icse computer applications sample papers.
Write any two rules for naming varible declaration.
Two rules of variable declaration are
(i) Variable name must start with an alphabet
(ii) Java keywords can't be used as variable name
Write down the difference between prefix and postfix operators.
Prefix and postfix operators while used in single statement has no difference. e.g
int a=10;
a++ or ++a has the same meaning,both are incremented by 1 after the statement is executed. But in expression they reacts differently.
e.g int a=10;
System.out.println(a++);
Here the output will be 10 as when postfix expression is used in expression, the expression executes first and then the operator works. So println() will display 10 and after that 'a' will be incremented by 1.
Again in prefix, the operator will work first and after that the expression will work.
e.g
int a=10;
System.out.println(++a);
Here the output will be 11.
This statement is correct as we know that type defines the nature and behavior of it's instance. By defining a class we also defines the nature and behavior of it's instance which are known as object.So class can be called as user defined data type.
Give an example of conditional operator.
Suppose int a,b,max are three variables and a and b holds unique value. We want to assign the maximum value on the variable max.
Using conditional statement we can write the codings as below
max=(a>b)?a:b;
Write a function to suppress negative elements of an array to bottom without altering the original sequence i.e. if array contains
5 , -4 , 3 , -2 , 6 , -11 , 12 , -8 , 9
Then the return array will be : 5 , 3 , 6, 12 , 9 , -4 , -2 , -11 , -8
int separate(int a[],int n)
{
int pos[]=new int[n];
int neg[]=new int[n];
int i,p=0,n1=0
for(i=0;i< n;i++)
{
if(a[i] >=0)
pos[p++]=a[i]
else
neg[n1++]
}
a[i]=pos[i];
for(int j=0;j< n1;j++)
a[i++]=neg[j];
return a;
}
What is inheritance and how is it useful in java ?
Inheritance is the process of acquiring properties, means data members and function members of any defined class in another class. Inheritance means reuse of codes. By the power of inheritance a class can acquire nature and behavior of a predefined class without writing a single line of code.
There are three types of inheritance - multilevel, multiple and hierarchical. Java supports multilevel and hierarchical inheritance.
What is an exception ? how does java deal with it ?
Exception means run time abnormality.
Java uses Exception Handler to deal with such situation. In java we can use throws clause, try....catch , try...finally block and throw clause as exception handler.
What is meant by polymorphism? Give an example.
Polymorphism is one of the four features of OOPs. When same operator or same function behaves differently in different environment, it is called polymorphism. There are three types polymorphism, operator overloading, function overloading and
function overriding. Constructor overloading is an example of function overloading.
State difference between call-by-value and call-by-reference.
When variables are used as actual and formal argument, it is called call by value and call by reference means when objects are used as actual and formal arguments.
What output will the following code fragment produce ?
int val=9, res , n =1000;
res = n + val > 1750 ? 400 : 200 ;
System.out.println(res);
Output will be 200
What will be the result of following two expressions if I =10 initially ?
I ) ++ I <=10 II ) I++ <=10For the first statement the result will be false and for the second statement the result will be true.Given the following set of identifiers:
long longval ; char ch ; int intval ; float fl ; short sh ;
Identify the datatype of the following expressions:
a) ‘a’-3 b) intval*longval-ch c) fl+ longval/sh d) longval * 3
Ans: a) int
b) long
c) float
d) long
Write a java program to print largest even and largest odd number from a list of
numbers entered through keyboard. The list terminates as soon as one enter 0 (zero).
import java.io.*;
class Max
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int maxeven=1,maxodd=2,n;
void take() throws IOException
{
for(;;)
{
System.out.println("Enter the number:");
n=Integer.parseInt(br.readLine());
if(n==0)
break;
if(n%2==0 && maxeven==1)
maxeven=n;
elseif(n%2==0 && n > maxeven)
maxeven=n;
elseif(n%2!=0 && maxodd=2)
maxodd=n;
elseif(n%2!=0 && n > maxodd)
maxodd=n;
}
System.out.println("Maximum even number="+maxeven);
System.out.println("Maximum odd number="+maxodd);
}
}
Write a java program to print fibonacci series i.e. 0 1 1 2 3 5 8 ……….
class Fib
{
int i,p=0,c=1,next;
void show(int n)
{
System.out.println("Series is as follows:" + p+" "+ c);
for(i=0;i< n-2;i++)
{
next=p+c;
System.out.println(" "+next);
p=c;
c=next;
}
}
}
Let A (n* n) be a two dimensional array. Write a program to find sum of all the elements which lie on either diagonal.
For example for the matrix shown below, your program should output 68 = (1 + 6+11+16+4+7+10+13)
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
import java.io.*;
class Mat
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int a[]=new int[4][4];
int i,j,sum=0
void take() throws IOException
{
for(i=0;i< 4;i++)
{
for(j=0;j< 4;j++)
{
System.out.println("Enter the number:");
a[i][j]=Integer.parseInt(br.readLine());
}
}
for(i=0;i < 4;i++)
{
for(j=0;j < 4;j++)
{
if(i==j || i+j==3)
sum+=a[i][j];
}
}
System.out.println("sum of the diagonals="+sum);
}
}
This page is on icse sample papers . If you have any doubt in any program, pl. feel free to put your comments. I am here to clear your doubts.
if i m doing java programming by making function inside the class and called it through the object from main method of that class.please tell me either this method is right for ICSE students or not.
ReplyDeleteDear friend! You can define main() function in BlueJ programs also and can call functions from inside the main() function. There is nothing wrong.
ReplyDeleteSir,can you please tell the logic for the following programs-
ReplyDeletea)WAP to enter a sentence and tell the longest word in it.
b)WAP to enter a sentence and then input a word and tell how many times the word appear in the sentence.
A STUDENT(ICSE)
email-bon2heg@gmail.com
For the first program you have to retrieve one after another word from the sentence using indexOf() function of String class.
ReplyDeleteAs you do not the number of words in the string, execute an infinite loop as we know that return value of
the function indexOf() is -1 when the searched character or string is not available in the invoking string object.
Within the loop consider the first word as the word with maximum length and afterwards compare the current word retrieved with the
word with maximum length and take necessary action. Keep it mind that when the loop breaks, strill the last word is compared, so compare it
outside the loop body.
import java.io.*;
class Pattern
{
String s1,s2,word;
int pos;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public void take() throws IOException
{
int x=0;
System.out.println("Enter the sentence:");
s1=br.readLine().trim();
while(true)
{
pos=s1.indexOf(' ');
if(pos<=0)
break;
s2=s1.substring(0,pos);
s1=s1.substring(pos+1);
if(x==0)
word=s2;
else if(s2.length()>word.length())
word=s2;
x++;
}
if(s1.length()>word.length())
word=s2;
System.out.println("Word with maximum length="+word);
}
public static void main(String args[]) throws IOException
{
Pattern ob=new Pattern();
ob.take();
}
}
For the second program you take the string, the word to be replaced and the word with which
replacement will be done. Search the word in the sentence and if found, take the left part
of the string, replace the word and take the right part of the sentense.
String functions to be used here. For string class functions visit: String class and its methods
The loop construction would be same as the previous program
import java.io.*;
class Pattern
{
String s1,s2,word1,word2;
int pos;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public void take() throws IOException
{
System.out.println("Enter the sentence:");
s1=br.readLine().trim();
System.out.println("Enter the word to replace:");
word1=br.readLine().trim();
System.out.println("Enter the word with which replacement will be done:");
word2=br.readLine().trim();
while(true)
{
pos=s1.indexOf(word1);
if(pos<=0)
break;
s2=s1.substring(0,pos);
s1=s1.substring(pos+1+word1.length());
s1=s2+ " " + word2+ " "+s1;
}
System.out.println("Word with maximum length="+s1);
}
public static void main(String args[]) throws IOException
{
Pattern ob=new Pattern();
ob.take();
}
}
Sir why do you all the time use functions in ur programs.I am a student in class 10th ICSE.I can do all these programs without function.
DeleteYou are doing java programs without using function? How??? Go through any of your programs and check at least one function is used. Please go through the encapsulation definition - only functions can manipulate data members.
DeleteYour question is that why I use functions in every program? A detail study of function is needed. Functions are mini programs and each functions perform a specific job. Please go through your own programs where you have used one function and the same function is taking values, manipulating values and displaying values. Suppose I want to take values only but your program will perform all the functions defined inside the function body. To make the thing clear - brake, horn are functions in a motor bike. You are the designer of the bike and not interested to keep so many functions so brake and horn are put in one function. What will happen? The rider will be happy?
I think you have got your answer. If you are still in the conception that you can do java programs without function, please send me one such sample.
I don't know you are from which school but I know some schools where teachers have some problems in using functions. This is simply lack of knowledge.
Thank You Sir!
ReplyDeletethanks
ReplyDeleteSir the output of the second program is jumbled up for both-I can't understand-
ReplyDelete1)output of second program-
....................................
[ Pattern.main({ }) ]
Enter the sentence:
The little fox jumped over the little lazy dog
Enter the word to replace:
the
Enter the word with which replacement will be done:
A
Word with maximum length=The little fox jumped over A little lazy dog
...........................
2)Sir, what is the difference bet. compareTo ()
and equals() function?
And in our book it tells that-compareTo compares two strings lexicographically..what does it mean here?
Sir,please help.
STUDENT(ICSE)
Thank you for bringing this error in my notice. Actually I developed this program on modifying a previous one on displaying the word with max. length in a sentence. That program is also posted in this blog. Simply replace the string 'Word with maximum length' with 'Modified string'
ReplyDeleteIn my post on 'string functions', I think I have discussed about these two functions. Anyway
equals() function compares two strings for equality. This function can tell you if the invoking string object and the argument string object are same.
'compareTo()' checks for equality also but it gives a clear idea about the invoking string object and the argument string object. If the return value is '0' it means both are same, if the return value is more than '0' it means the invoking string is greater than the argument string. A negative return value indicates that the argument string is greater.
Sir,But please notice that the replacement by 'A' in the sentence did not occur on first 'the' but on the second one!
ReplyDelete--------------------
[ Pattern.main({ }) ]
Enter the sentence:
The little fox jumped over the little lazy dog
Enter the word with which replacement will be done:
A
Modified String=The little fox jumped over A little lazy dog
---------------------
Please help!
Your obedient
STUDENT(ICSE)
Your sentence has started with 'The', not 'the' and you want to replace 'the' with 'A' then how the starting 'The' will be replaced?
ReplyDeleteIf you want to replace all words with same alphabets, simply modify the sentence and the words into upper case, replace words and after that modified upper case sentence into normal sentence with the first character in upper case and the others in lower case.
OH!I understand!Thank you,Sir!
ReplyDeleteAyan(ICSE)
Sir.,please can you help me out with how to hide a class when using two classes in a same program,accessing the methods of the first class from the second class without running the 1st class......i am pretty weak in computer and i will be appearing in ICSE 11...so it wud be great if u help.....
ReplyDeleteimport java.io.*;
ReplyDeleteclass First
{
int i,j,k,x;
public void display()
{
for(i=0;i<5;i++)
{
x=i+1;
for(j=0;j<=i;j++)
{
System.out.print(x+" ");
if(x==8)
x--;
else
x++;
}
x=x-2;
for(k=0;k<i;k++)
{
System.out.print(x+" ");
x--;
}
System.out.println();
}
}
}
Class Smith1
{
public static void main(String args[])throws IOException
{
First ob=new First();
ob.display();
}
}
Thank you..sir
ReplyDelete@ Anonymous
ReplyDeleteis this Ayan Bhattacharjee?
sir can u kindly solve this below prg and give me before tomo evening,because i have my 12th computer practicals on this friday...
ReplyDeleteAccept a paragraph of text consisting of sentences that are terminated by either “.”, “,”, “!” or a “?” followed by a space. Assume that there can be a maximum of 5 sentences in a paragraph.
Design a program to perform the following:
(a) Arrange the sentences in alphabetical order of words, sentence by sentence.
(b) Separate the words which begin with a vowel.
Sample data 1:
INPUT : HELLO! HOW ARE YOU? WHEN ARE YOU COMING? HOPE TO SEE YOU SOON.
OUTPUT: HELLO! ARE HOW YOU? ARE COMING WHEN YOU? HOPE SEE SOON TO
YOU
Please check my post 'ISC Computer Practical - 2008' in this blog.
ReplyDeleteSir
ReplyDeleteplease tell me the programme of
n=4
1+1+1+1
1+1+2
1+3
2+2
from sarita lko
The program is posted recently. What you want to know?
ReplyDeletesir i want a program (menu driven) to perform addition,subtraction,multiplication of matrix
ReplyDeletePlease check my post on 20 March 2011
ReplyDeleteplz post a sample program for this ques:
ReplyDeleteWAP TO INPUT A THREE WORD NAME (e.g-Subhas chandra bose) and the output should be : "S.C. Bose".... plz do this using SCANNER CLASSES.
Please check my post on 28 January 2011.
ReplyDeleteVery happy to find this blog... Can you please give an example to show constructors are used to initilize private data members of a class.
ReplyDeleteclass A
ReplyDelete{
private int a,b;
A(int x, int y)
{
a=x;
b=b;
}
void show()
{
System.out.println("Sum=" (a+b));
}
}
please solve this:
ReplyDeleteWAP in java to accept an email id from the user and then print whether it is a valid email or not.
Please check my recent post
ReplyDeletePlease solve:
ReplyDeleteWrite a program to print all prime palindrome numbers between 100 and 9999.
import java.io.*;
ReplyDeleteclass Word
{
int i,j;
public void show()
{
for(i=100; i< =9999; i++)
{
if(prime(i) && palindrome(i))
System.out.print(" "+i);
}
}
boolean prime( int n)
{
for(j=2;j< n;j++)
{
if(n%j==0)
break;
}
if(j==n)
return true;
else
return false;
}
boolean palindrome(int n)
{
int r=0;
for(j=n;j >0;j=j/10)
{
r=r*10+j%10;
}
if(r==n)
return true;
else
return false;
}
public static void main(String args[])
{
Word ob=new Word();
ob.show();
}
}
sir could you tell me how to check if a no is automorphic or not
ReplyDeleteThis type of program is posted in my blog. Please search.
ReplyDeleteHi,can you please host a program to enter a string using scanner and find out the number of words,spaces,letters,numbers and special characters? I am new to java and I would be very thankful if you could host this program.thanks in advance
ReplyDeletePlease check my post on 25 October 2011.
ReplyDeletewap to input any given string to calculate the total no. of character and vowels present in the string and also reverse it.
ReplyDeleteimport java.io.*;
ReplyDeletepublic class Str
{
int i,len,v=0,c=0;
String str,str1,str2="";
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public void show()throws Exception
{
System.out.println("Enter the string:");
str=br.readLine();
str1=str.toUpperCase();
len=str1.length();
for(i=0;i< len;i++)
{
switch(str1.charAt(i))
{
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
v++;
break;
}
if (str1.charAt(i)>=65 && str1.charAt(i)<=90)
c++;
}
System.out.println("\n Number of vowels="+v);
System.out.println("\n Number of characters="+c);
for(i=len-1;i>=0;i--)
str2=str2+str.charAt(i);
System.out.println("\n Reversed string="+str2);
}
public static void main(String args[])throws Exception
{
Str ob=new Str();
ob.show();
}
}
Wap to input a string and print frequency to each character of the string.
ReplyDeleteToday I have posted the same program.
ReplyDeletewap to derive a calculator which is capable of doing basic calculation using switch case.
ReplyDeletePlease check today's post.
ReplyDeleteplease sove the pattern
ReplyDelete1
10
101
1010
10101
I think this program is posted in my blog. Please navigate through 'label'. Anyway I am posting the program again.
ReplyDeleteclass P
{
int i,j;
public void show()
{
for(i=0;i<5;i++)
{
for(j=0;j<=i;j++)
{
if(j%2==0)
System.out.print("!");
else
System.out.print(")");
}
System.out.println();
}
}
}
Oh! What a mistake. Please write '1' instead of '!' and '0' instead of ')'.
ReplyDelete_______A
ReplyDelete_____A B A
____A B C B A
___A B C D C B A
__A B C D E D C B A
___A B C D C B A
____A B C B A
______A B A
________A
public class Series
ReplyDelete{
int i,m,n,k,a=0,b=0;
char x;
public void show()
{
for(i=0;i<9;i++)
{
x='A';
for(k=a;k<4;k++)
System.out.print(" ");
for(m=0;m<=b;m++)
{
System.out.print(x);
x=(char)(x+1);
}
x=(char)(x-2);
for(n=0;n<b;n++)
{
System.out.print(x);
x=(char)(x-1);
}
System.out.println();
if(i<9/2)
{
a++;
b++;
}
else
{
a--;
b--;
}
}
}
public static void main(String args[]) throws Exception
{
Series ob=new Series();
ob.show();
}
}
________1
ReplyDelete______1 2 1
____1 2 3 2 1
__1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
please solve the above pattern.
public class Series
ReplyDelete{
int i,j,m,n,x;
char ch;
public void show()
{
for(i=0;i<5;i++)
{
x=1;
for(j=i;j<4;j++)
System.out.print(" ");
for(m=0;m<=i;m++)
System.out.print(x++);
x=x-2;
for(n=0;n<i;n++)
System.out.print(x--);
System.out.println();
}
}
public static void main(String args[]) throws Exception
{
Series ob=new Series();
ob.show();
}
}
sir please tell the program of this pattern.
ReplyDelete____________________*
__________________*___*
________________*_______*
______________*___________*
________________*________*
__________________*____*
____________________*
import java.io.*;
Deleteclass Arr
{
int i,j,x,y=-1,k,m=4;
public void show()
{
m=5;
for (i=0;i<7;i++)
{
for(j=0;j<m;j++)
System.out.print(" ");
if(i!=6)
System.out.print("*");
for(k=0;k<y;k++)
System.out.print(" ");
if(i!=0)
System.out.print("*");
System.out.println();
if(i<7/2)
{
y=y+2;
m=m-1;
}
else
{
y=y-2;
m=m+1;
}
}
}
}
Wap which will ask the user to enter a choice and based on the choice the following operation will take place.
ReplyDeleteif choice=1; then sum of even nos. from the series of 10 nos.
if choice=2; then sum of odd nos. from a series of 10 nos.
if choice=3; then it will check whether the no is perfect or not from a series of 10 nos.
please solve this program as early as posible.
Check my post on 12 January 2012
ReplyDeletesir i want to ask a question ,write a program in java to accept an integer and print the frequency of all the digits present in the number.
ReplyDeleteAlready posted in this site, search it.
DeleteHow to variable description or mnemonic codes in java?
ReplyDeleteall the programmes state that make a variable description or mnemonic code... but i am unaware how to actually make it!
Can you please help sir!?
Please visit Page1 and Page2.
Deletethanxx a lott sir!!
Deletesir, i could you please tell me the use of wrapping a primitive datatypes's value in an object...and how can an object have a specific value
ReplyDeletefor e.g Integer i = new Integer(5);
what will this statement do?
By this statement int value '5' is converted into an object 'i'. In java collection group of classes like LinkedList, Vector etc, only objects are stored. In those situations, wrapper classes are required.
Deleteplease solve the pattern
ReplyDelete5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
class A
Delete{
public void show()
{
int i,j;
for(i=5;i>=1;i--)
{
for(j=i;j>=1;j--)
{
System.out.print(i+" ");
}
System.out.println();
}
}
}
Sir..can you pls solve the programs of icse 2012 board ques...sir pls atleast some ques which you think as tuff.....
ReplyDeleteicse student appearing 2013
Very soon the solved paper will be posted.
Deletewrite a program to accept "n" number of numbers from the user and display if two successive nos. entered happens to be even
ReplyDeleteYour program will be posted very soon in BlueJ category
Deletesir please solve this program
ReplyDelete4
43
432
4321
class P
Delete{
public void show()
{
int i,j,x;
for(i=0;i<4;i++)
{
x=4;
for(j=0;j<=i;j++)
{
System.out.print(x);
x--;
}
System.out.println();
}
}
}
thnk u sir!!
Deletesir can u please write the program for the pattern
ReplyDelete1
13
135
1357
13579
class Pat
Delete{
int i,j,x;
void show()
{
for(i=0;i<5;i++)
{
x=1;
for)j=0;j<=i;j++)
{
System.out.print(x);
x=x+2;
}
System.out.println();
}
}
}
sir please help me wid these pattern
ReplyDeleteJAVA
AVA
VA
A
fast please!!!!!
class J
Delete{
String str="JAVA";
int i,j,len;
public void show()
{
len=str.length();
for(i=0;i<len;i++)
{
for(j=i;j<len;j++)
{
System.out.print(str.charAt(j));
}
System.out.println();
}
}
}
sir ,plz kindly solve my program i.e
ReplyDeletewrite a program in java to store 10 no.'s in a single dimensonal array and sort it in ascending order and display the sorted array.
Please go through my sorting programs.
Deletesir can u plz solve my problem as i am getting confused with the foll. pattern of latin square
ReplyDelete1234
2341
3412
4123
public class sud
Delete{
void main()
{
String str="1234";
for(int i=0;i<str.length();i++)
{
System.out.println(str.substring(i)+str.substring(0,i));
}
}
}
sir please solve this:
ReplyDeletewrite a program to count the number of uppercase,lowercase,digit and special characters in a given string using character class
Please check the latest post.
DeleteSir,please rectify the error of the program:
ReplyDeleteWrite a program to count the number of uppercase,lowercase,digit and special characters in a given string using character class.
class countchar
{
public static void countchar(String str)
{
int cup=0,clo=0,cdig=0,space=0,csp=0;
char a[]=str.toCharArray();
int l=str.length();
for(int i=0;i<l;i++)
{
if (Char.isUpperCase(a[i])))
cup++;
if(Char(is.LowerCase(a[i])))
clo++;
if(Char(is.Digit(a[i])))
cdig++;
if(Char.isWhitespace(a[i])))
space++;
if(!Char(is.LetterorDigit() && !Char(is.Whitespace(a[i]))))
csp++;
}
System.out.println("The appearance of Uppercase characters are "+cup);
System.out.println("The appearance of Lowercase characters are "+clo);
System.out.println("The appearance of Digits are "+cdig);
System.out.println("The appearance of Uppercase characters are "+space);
System.out.println("The appearance of Special characters are "+csp);
}
}
Class name is Character and not 'Char'. You have used wrong method names also. isLowerCase(), isDigit() etc are the method names.
Deletesir please solve this:
ReplyDeleteWrite a program and print even numbers using scanner class.
import java.util.Scanner;
public class ParseString
{
public static void main()
{
Scanner scanner=new Scanner("1 2 3 4 5 6 7 8 9 10");
while(scanner.hasNextInt());
{
int num=scanner.nextInt();
if(num%2==0)
System.out.println(+num);
}
}
}
import java.util.Scanner;
Deletepublic class archisman
{
public static void main(String args[])
{
Scanner scanner=new Scanner("1 2 3 4 5 6 7 8 9 10");
while(scanner.hasNextInt())
{
int num=scanner.nextInt();
if(num%2==0)
System.out.println(+num);
}
}
}
Wap to check whether a given no. is disarium or not. ICSE student
ReplyDeletePosted on 8 January 2014
Deleteplz upload a program to print Subhash Chandra ose as S.C.Bose
ReplyDeletePl go through the page: http://schooljava.blogspot.com/2011/01/bluej-program-on-string-modification.html
Deletewap to accept a non-palindromic word. display the new word after making it a palindrome.
ReplyDeleteS.I- I.C.S.E
S.O-E.S.C.I
Not clear, do you want to reverse the word?
Deletewap to input a sentence and print the word containing maximum numbers of vowels
DeleteS/I: HAPPPY NEW YEAR
O/P: YEAR
Solution posted yesterday, Pl. check the latest posts.
Deleteyes, it will be revere of a word
Deleteimport java.io.*;
Deleteclass String1
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s;
int i,len;
public void takeString()throws Exception
{
System.out.print("\nEnter the word (I.C.S.E):");
s=br.readLine();
len=s.length();
for(i=len-1;i>=0;i--)
System.out.print(s.charAt(i));
}
public static void main(String args[])throws Exception
{
String1 ob=new String1();
ob.takeString();
}
}
wap to accept a word and print the following pattern
ReplyDeleteS/I: INDIA
O/P:INDIA
INDI
IND
IN
I
Posted today...
Deletewrite a menu driven program to do the following.
ReplyDeletesub part a:area of the circle.
sub part b:area of the square.
sub part c:area of the rectangle.
Program already posted. Please check
Deletewrite a program to remove a double letter.
ReplyDeleteNot clear. Pl. elaborate.
Delete1. Wap to accept a word & print it in the following pattern(the length of the word should be add)
ReplyDeleteD
R D E
O R D E R
2. Wap to accept a sentence and print in the following format
Sample input: This
This is
This is an
This is an example
3. wap to accept a sentence and print all the character except the vowels. In case of vowels print the character next to two places of it.
4. wap to accept a sentence and print the middle word provided the number of words are add.
5. Wap in java to find the no. of zero’s in the following.
I=3040
All programs are posted on 26 February 2015
DeleteSir, what will be the value stored in z after the following operation if y is initially 10
ReplyDeleteint z=(++y*(y++ +5)); (using the norms of operator precedence and associativity)
Ans: Value of z=176
Deletewap to accept a multidigit number and check whether it is weakarm number or not.
ReplyDeleteCheck today's post
Deletewap to accept a multidigit number and check whether it is prime palindrome or not.
ReplyDeleteCheck the program on this link: http://schooljava.blogspot.com/2014/05/program-on-palindrome-and-prime-number.html
Deletewap to print all the automorphic numbers within a given range provided by the user.
ReplyDeleteCheck this link: http://schooljava.blogspot.com/2012/08/display-automorphic-numbers-from-1-to.html
DeleteWAP TO PRINT INITIALS OF A NAME EXCEPT SURNAME
ReplyDeleteINPUT SUBHAS CHANDRA BOSE
OUTPUT S.C.BOSE
This program is already posted in this site. Check the program in this link: http://schooljava.blogspot.com/2011/01/bluej-program-on-string-modification.html
Deletesir how to invoke a fucnction.
ReplyDeleteis it necessary to create objects and invoke - student icse
You have to understand encapsulation first to know how a function is invoked. Functions are members of an object and objects members are accessed using the object (if the members are instance members, static members are invoked using the class name e.g 'Integer.parseInt()')
DeleteYou can download my eBook on BlueJ: http://imojo.in/4wxacb
i am not able to score good marks in computer how can i improve my marks and score 100
ReplyDeleteIf you are from Burdwan, I can help you directly otherwise go through this site and very soon you will get BlueJ study material in my 'Download eBook'
Deletewap to accept a string and print the longest word
ReplyDeleteWill be posted with 1-2 days
Delete1.enter a sentence in string and print the longest word among them
ReplyDelete2.enter a sentence in string and print the words cotaining vovels
Posted on 1 April 2016
Delete