English

(English Medium) ICSE Class 10 - CISCE Important Questions

Advertisements
Subjects
Topics
Subjects
Popular subjects
Topics

Please select a subject first

Advertisements
Advertisements
< prev  1581 to 1600 of 3901  next > 

Which of the following is not true with regards to a switch statement?

Appears in 1 question paper
Chapter: [7] Conditional Statements in Java
Concept: Introduction of Conditional Statements in Java

Rewrite the following code using single if statement.

if(code=='g')
System.out.println("GREEN");
else if(code=='G')
System.out.println("GREEN");
Appears in 1 question paper
Chapter: [7] Conditional Statements in Java
Concept: Introduction of Conditional Statements in Java

A student executes the following program segment and gets an error. Identify the statement which has an error, correct the same to get the output as WIN.

boolean x=true;
switch(x)
{     case 1:System.out.println("WIN");break;
      case 2;System.out.println("LOOSE");
}
Appears in 1 question paper
Chapter: [7] Conditional Statements in Java
Concept: Introduction of Conditional Statements in Java

Consider the following program segment and answer the questions below:

class calculate
{
     int a;double b;
     calculate()
     {
     a=0;
     b=0.0;
     }
     calculate(int x, double y)
     {
     a=x;
     b=y;
     }
   void sum()
   {
     System.out.println(a*b);
}}

Name the type of constructors used in the above program segment.

Appears in 1 question paper
Chapter: [7] Constructors
Concept: Features of a Constructor

Identify and name the following tokens:

(i) public
(ii) ‘a’
(iii) ==
(iv) {}

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

Using the switch-case statement, write a menu driven program to do the following :

(a) To generate and print Letters from A to Z and their Unicode Letters Unicode

(b) Display the following pattern using iteration (looping) statement: 1

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Introduction of Iterative Constructs in Java

Define Encapsulation.

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Scope of Variables in Java

Name any two types of access specifiers.

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

Write two separate programs to generate the following patterns using iteration (loop) statement:

(a)

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Introduction of Iterative Constructs in Java

Write two separate programs to generate the following patterns using iteration (loop) statement:

(b) 

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Introduction of Iterative Constructs in Java

Study the method and answer the given questions.
public void sampleMethod()
{ for (int i=0; i < 3; i++)
{ for (int j = 0; j<2; j++)
{int number = (int) (Math.random() * 10);
System.out.println(number); } } }
(i) How many times does the loop execute ?
(ii) What is the range of possible values stored in the variable number ? 

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

Study the method and answer the given questions.
public void sampleMethod()

{ for (int i=0; i < 3; i++)
{ for (int j = 0; j<2; j++)
{int number = (int) (Math.random() * 10);
System.out.println(number); } } }
(i) How many times does the loop execute ?

(ii) What is the range of possible values stored in the variable number ?

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

The access modifier that gives the most accessibility is ______

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

State the type of loop in the given program segment

for (int i = 5; i l = 0; i =2)

System.out.println(i);

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Entry Controlled Loop

The access specifier that gives least accessibility is ______.

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

Which of the following are entry-controlled loops?

  1. for
  2. while
  3. do..while
  4. switch
Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Entry Controlled Loop

To execute a loop 10 times, which of the following is correct?

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Entry Controlled Loop

How many times will the following loop execute? Write the output of the code:

int x=10;
while(true) {
System.out.println(x++*2);
if(x%3==0)
break;
}
Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Entry Controlled Loop

Define a class to accept a number and check whether it is a SUPERSPY number or not. A number is called SUPERSPY if the sum of the digits equals the number of the digits.

Example1:

Input: 1021

Output: SUPERSPY number [SUM OF THE DIGITS = 1+0+2+1 = 4, NUMBER OF DIGITS = 4]

Example2:

Input: 125

Output: Not an SUPERSPY number [1+2+5 is not equal to 3]

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Introduction of Iterative Constructs in Java

Give the output of following code and mention how many times the loop will execute?

int i;
for(i=5; i> =l;i~)
{
if(i%2 ==1)
continue;
System.out.print(i+ ”
}

Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop
< prev  1581 to 1600 of 3901  next > 
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×