Trending ▼   ResFinder  

computer application worksheet

9 pages, 50 questions, 4 questions with responses, 4 total responses,    0    0
Namratha Simha
Shantiniketan Trust School, Bangalore
+Fave Message
 Home > namratha_simha123 >

Formatting page ...

Worksheet 1 Find the outputs : 1. int a=0; if (a>0 && a<20) a++; else a--; System.out.println(a); 2. int x=2, y=5; x=++y - (- -x); y+=x; System.out.println( x= +x+ y= +y); 3. int a=4,b=-3,c; c=b-- + (++a) b; System.out.println( a= +a+ b= +b+ c= +c); 4. int a=10,b=15; while(++a<--b) System.out.println(b); System.out.println(a); 5. int a=10,b=15; while(++a<--b) { System.out.print(b); System.out.print(a); } 6.int a=63,b=36; boolean x=(a>b)?true:false; int y=(a<b)?a:b; System.out.println( x = +x+ y= +y); 7.What will be the values of n and ch? Char c='D'; int n=c+1; char ch=(char)n 8.What will be the value of x after the following code? Int x=4; x+=(x++)+(++x)+x; 9.double x=2.9, y=2.5; System.out.println(Math.min(Math.floor(x),y)); System.out.println(Math.max(Math.ceil(x),y)); 10.String x= Examination ; System.out.println(x.charAt(2)==x.charAt(6)); 11. Int the following code write the names of : class variable, instance variable, local variable and method argument. Class A { static int j=9; int k; void calc(int p) { double n=10; .. } } 12. output? Int p=10; do { p- -; System.out.println( p= +p); p--; }while(p>=2); 13. Write the equivalent ternary operator for the following code : int h,n=5,m=11; if (n>m) h=0; else h=1; 14.output System.out.println( four +4+2); System.out.println( Four +(4+2)); System.out.println(4+2); 15. o/p int m=2,n=15; for(int i=1;i<5;i++) m++; n--; System.out.println( m= +m); System.out.println(( n= +n); 16. What will be the data type if the following expression is evaluated? Char c; int I; long m; c+i*(m+c); 17. What will be the value of x, if int a=10, b=5, c=8; float x=(float) a+b*c; 18. o/p class Arithmetic { void calc() { int a=4, b=6, c=10; add(a,b); System.out.println( a= +a+ = +b+ c= +c); } void add(int a,int b) { a=5; int c=a+b; System.out.println(( the value of a,b,c are : +a+b+c); } } 19. Assign a value pi (3.142) to a variable with the required data type. The value should not change throught the program. 20.what will be the value of z? Int x=20,y=10,z; z=++x*(y--)-y? 21.o/p int a=0; if (a>0 && a<20) a++; else a--; System.out.println(a); 22. o/p int a=5, b=2,c; if(a>b || a!=b) c=++a + --b; System.out.print(c+ +a+ +b); 23. o/p int i=1; while(i++<=1) { i++; System.out.println(i+ ); } System.out.print(i); 24.o/p int i=1; while(i++<=1) { i++; System.out.print(i+ ); } System.out.println(i); 25. What will be the o/p if the value of num is 123? void x(int num) { int a,b=num,c=0,d,s=0; while(b!=0) { d=b%10; a=(int)Math.pow(10,c++); System.out.println((d*a); b=b/10; } } 26.System.out.println( eight= +3+5); System.out.println( six= +(2+4)); 27.o/p int i=1; while(i++>=1) { if(i>=5) break; } System.out.print(i); 28.o/p int i=3; float k=3.2f; long m=-3; if(Math.ceil(i)<Math.floor(k)) { if (Math.abs(i)==m) System.out.println(i); else System.out.println(j); } else System.out.println(Math.abs(m)+1); 29. long m=-3; System.out.println(Math.abs(m)+1); System.out.println( Answer +Math.abs(m)+1); 30. int a=5,b=3; b+=(b+a) / ((++a b++) - (a-b)); System.out.println(a+ \t +b); 31. o/p int x=10, y=21; System.out.println(Math.abs(Math.max(Math.min(x,y),y))); 32.o/p int x=20; String sup=(x<15)? small :(x<22)? tiny : huge ; System.out.println(sup); 33.o/p class P { p s v m() { P o=new P(); o.start(); } void start() { String s1= slip ; String s2=fix(s1); System.out.println(s1+ +s2); } String fix(String s1) { s1=s1+ stream ; System.out.println(s1+ ); return stream ; } } 34.o/p int n=0; int i=1; while(i<4) { int j=1; while(j<=i) { n+=1; System.out.println(j); j++; } System.out.println(); i=i+1; } 35.o/p System.out.println(Math.max(Math.ceil(-7.65), Math.floor(-8.65))); 36. o/p int y=14; int z=++y * (y-- + --y); System.out.println(z); 37. o/p int n=10; while(n!=1) { if(n%2==0) n=n/2; else n=(3*n)+1; System.out.println(n); } 38. correct the error : class c3 { void double(int x) { x=x*2; System.out.println(); } static void d() { double(); } } 39. How many times will the following loop be executed ? a) int x=5, y=50; while(x<=y) { x=y/x; } b)int s=0,i=0; while(s++<5) { System.out.println(++s); } 40. What will be the o/p if a. int x=10 b. int x=29 while(x>0) { x=x/10 ; System.out.println( x = +x); } Write the equivalent while loop for the following : int n=25; for(int i=10;i>=2;i=i-2) n++; Write the equivalent while loop for the following : int f=1,i; for(int i=1;i<=5;i++) {f*=i; System.out.println((f); } What will be the value of i after evaluating the following : int i=17; i>>=1; i=8(17) Write the java expression for ******************** 1. consider the following statement and answer the questions that follow : String x[]={ Hello , World }; a. What is x[1].length() ? b. What is x.length ? 2.State the data type and values of a and b, after the following statements are executed : String s1= computer , s2= applications ; a=s1.compareTo(s2); b=s1.equals(s2); 3. output? String s= malayalam ; System.out.println(s.indexOf('m'); System.out.println(s.lastIndexOf('m'); 4. if String x= Happy Awesome World , write the function to replace all the 'o' characters with 'a' characters. 5.o/p String s1= MINORITY ; String s2= REPORT ; a. System.out.println(s1.substring(0,3)+(s2.substring(3,5); b. System.out.println(s2.sustring(2)); c. System.out.println(s2.replace('p','s')); d. System.out.println(s1.charAt(s1.indexOf('R')+s2.indexOf('R'); 6.o/p char c[]={'a','b','c'}; String s1=new String(s); String s2= abc ; System.out.println(s2.compareTo(s1)); System.out.println(s2.equals(s1)); System.out.println(s1.length()); System.out.println(s1.concat(s2)); 7.o/p System.out.println(( WONDERFUL .substring(6)); System.out.println(( Bravery .indexOf('r',3)); 8. o/p boolean k; k=( BLUEJ .length()> JAVA .length())?true:false); System.out.println(k); 9. o/p char a[]={'a',b','1','?','A',' '}; System.out.println(Character.isDigit(a[2])); System.out.println(Character.toLowerCase(a[4])); System.out.println(Character.isWhitespace(a[5]); System.out.println(Character.isLetterOrDigit(a[0])); ********** 2. Write the declaration statements for : a, A 1-d array of size 10 b. A 2-d array having 4 rows and 6 columns 3.Write the statement to declare and initialize an integer array of size 5 with the following values : 3,5,8,7,10. 4. If int a[2][3] is an array, how do you access the element in the 1st row and 2nd column? 5. o/p int [] a={9,4,3,7,0}; for(i=0;i<=3;i++) { a[i+1]=(a[i]%2==0?++a[i]: a[i]); System.out.println(a[i]+ ); }

Formatting page ...

Related ResPapers
ICSE Board Specimen 2016 : Environmental Science
by icse 
ICSE Prelims 2016 : English I (Shatavisha Public School, Hooghly)
by shuvamatk 
ICSE Prelims 2016 : (Julien Day School (JDS), Hooghly, Howrah)
by ashokbairagi 
patel
by an12370 

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


Darshan Deshpande

(3)

Adithya Kannan

(1)

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 


© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

namratha_simha123 chat