हिंदी

ISC (Commerce) कक्षा १२ - CISCE Important Questions

Advertisements
विषयों
अध्याय
विषयों
मुख्य विषय
अध्याय

Please select a subject first

Advertisements
Advertisements
< prev  381 to 400 of 836  next > 

What is the output of the statement given below?

System.out.print("FAN" + ("AUTOMATIC".charAt(5) ) );
Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Example Algorithms that Use Structured Data Types (E.G. Searching, Finding Maximum/Minimum, Sorting Techniques, Solving Systems of Linear Equations, Substring, Concatenation, Length, Access to Char in String, Etc.)

Design a class Check which checks whether a word is a palindrome or not.

(Palindrome words are those which spell the same from either ends).

Example: MADAM, LEVEL etc.

The details of the members of the class are given below:

Class name Check
Data members/instance variables:
wrd stores a word
len to store the length of the word
Methods/Member functions:
Check( ) default constructor
void acceptword( ) to accept the word
boolean palindrome( ) checks and returns ‘true’ if the word is a palindrome otherwise returns ‘false’
void display( ) displays the word along with an appropriate message

Specify the class Check giving details of the constructor, void acceptword( ), boolean palindrome( ) and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Basic Input/Output Using Scanner and Printer Classes from JDK

Design a class Toggle which toggles a word by converting all upper case alphabets to lower case and vice versa.

Example: The word “mOTivATe” becomes “MotIVatE”

The details of the members of the class are given below:

Class name Toggle
Data members/instance variables:
str stores a word
newstr stores the toggled word
len to store the length of the word
Methods/Member functions:
Toggle( ) default constructor
void readword( ) to accept the word
void toggle( ) converts the upper case alphabets to lower case and all lower case alphabets to upper case and stores it in newstr
void display( ) displays the original word along with the toggled word

Specify the class Toggle giving details of the constructor, void readword( ), void toggle( ) and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Basic Input/Output Using Scanner and Printer Classes from JDK

State any one use of interfaces in Java.

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Interfaces in Java

An array ARR [ -5 .....15, 10.....20] stores elements in Row Major Wise with each element requiring 2 bytes of storage. Find the address of ARR [10] [15] when the base address is 2500.

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Structured Data Types - Arrays (Single and Multi-dimensional), Strings

Assertion: In Java, the String class is used to create and manipulate strings, and it is immutable.

Reason: Immutability ensures that once a String object is created, its value cannot be changed.

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Structured Data Types - Arrays (Single and Multi-dimensional), Strings

A matrix M[-6….10, 4…15] is stored in the memory, with each element requiring 4 bytes of storage. If the base address is 1025, find the address of M[4][8] when the matrix is stored in column major-wise.

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Example Algorithms that Use Structured Data Types (E.G. Searching, Finding Maximum/Minimum, Sorting Techniques, Solving Systems of Linear Equations, Substring, Concatenation, Length, Access to Char in String, Etc.)

The following function getIt() is a part of some class. Assume x is a positive integer, f is the lower bound of arr[ ] and l is the upper bound of the arr[ ].

Answer the questions given below along with dry run/working.

public int getIt(int x,intarr[],int f,int l)
  {
   if(f>l)
     return-1;
   int m=(f+l)/2;
   if(arr[m]<x)
     return getIt(x,m+1,l);
   else if(arr[m]>x)
     return getIt(x,f,m-1);
   else
     return m;
}
  1. What will the function getIt( ) return if arr[ ] = {10,20,30,40,50} and x = 40?
  2. What is function getIt( ) performing apart from recursion?

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Example Algorithms that Use Structured Data Types (E.G. Searching, Finding Maximum/Minimum, Sorting Techniques, Solving Systems of Linear Equations, Substring, Concatenation, Length, Access to Char in String, Etc.)

Given are two strings, input string and a mask string that remove all the characters of the mask string from the original string.

Example: INPUT: ORIGINALSTRING: communication
    MASK STRING: mont
  OUTPUT: cuicai  

A class StringOp is defined as follows to perform above operation.

Some of the members of the class are given below:

Class name StringOp
Data members/instance variables:
str to store the original string
msk to store the mask string
nstr to store the resultant string
Methods / Member functions:
StringOp() default constructor to initialize the data member with legal initial value
void accept( ) to accept the original string str and the mask string msk in lower case
void form() to form the new string nstr after removal of characters present in mask from the original string
void display( ) to display the original string and the newly formed string nstr

Specify the class StringOp giving details of the constructor( ), void accept( ), void form() and void display( ). Define a main( ) function to create an object and call all the functions accordingly to enable the task.

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Structured Data Types - Arrays (Single and Multi-dimensional), Strings

A class Mixarray contains an array of integer elements along with its capacity (More than or equal to 3). Using the following description, form a new array of integers which will contain only the first 3 elements of the two different arrays one after another.

Example:

Array1: { 78, 90, 100, 45, 67 }

Array2: {10, 67, 200, 90 }

Resultant Array: { 78, 90, 100, 10, 67, 200}

The details of the members of the class are given below:

Class name Mixarray
Data members/instance variables:
arr[] integer array
cap integer to store the capacity of the array
Member functions/methods:
Mixarray (int mm ) to initialize the capacity of the array cap=mm
void input( ) to accept the elements of the array
Mixarray mix(Mixarray P, Mixarray Q) returns the resultant array having the first 3 elements of the array of objects P and Q
void display( ) to display the array with an appropriate message.

Specify the class Mixarraygiving details of the constructor(int), void input( ), Mixarray mix(Mixarray,Mixarray) and void display( ). Define a main( ) function to create objects and call all the functions accordingly to enable the task.

Appears in 1 question paper
Chapter: [10] Arrays, Strings
Concept: Structured Data Types - Arrays (Single and Multi-dimensional), Strings

Give one reason, why iteration is better than recursion.

Appears in 1 question paper
Chapter: [11] Recursion
Concept: Recursion

Differentiate between direct recursion and indirect recursion.

Appears in 1 question paper
Chapter: [11] Recursion
Concept: Recursion

A class Fibo has been defined to generate the Fibonacci series 0, 1, 1, 2, 3, 5, 8, 13, ……. (Fibonacci series are those in which the sum of the previous two terms is equal to the next term).

Some of the members of the class are given below:

Class name Fibo
Data member/instance variable:
start integer to store the start value
end integer to store the end value
Member functions/methods:
Fibo( ) default constructor
void read( ) to accept the numbers
int fibo(int n) return the nth term of a Fibonacci series using recursive technique
void display( ) displays the Fibonacci series from start to end by invoking the function fibo()

Specify the class Fibo, giving details of the Constructor, void read( ), int fibo(int), and void display( ). Define the main() function to create an object and call the functions accordingly to enable the task.

Appears in 1 question paper
Chapter: [11] Recursion
Concept: Simple Recursive Functions (e.g. Factorial, GCD, Binary Search, Conversion of Representations of Numbers Between Different Bases)

A class Gcd has been defined to find the Greatest Common Divisor of two integer numbers. Some of the members of the class are given below:

Class name Gcd
Data member/instance variable:
num1 integer to store the first number
num2 integer to store the second number
Member functions/methods:
Gcd( ) default constructor
void accept( ) to accept the numbers
int gcd(int x,int y) return the GCD of the two numbers x and y using recursive technique
void display( ) displays the result with an appropriate message

Specify the class Gcd, giving details of the Constructor, void accept( ), int gcd(int,int), and void display( ). Define the main() function to create an object and call the functions accordingly to enable the task.

Appears in 1 question paper
Chapter: [11] Recursion
Concept: Simple Recursive Functions (e.g. Factorial, GCD, Binary Search, Conversion of Representations of Numbers Between Different Bases)

Assertion: Recursive data structure follows the LIFO principle.

Reason: Execution of recursive code follows the concepts of data structure Queue.

Appears in 1 question paper
Chapter: [11] Recursion
Concept: Simple Recursive Functions (e.g. Factorial, GCD, Binary Search, Conversion of Representations of Numbers Between Different Bases)

The following function is a part of some class:

int jolly(int[] x, int n, int m)
  {
if (n<0)
  return m;
else if(n<x.length)
  m=(x[n]>m)?x[n]:m;
return jolly(x, --n, m);
  }
  1. What will be the output of jolly() when the value of x[ ]={6,3,4,7,1}, n=4 and m=0?
  2. What function does jolly() perform, apart from recursion?
Appears in 1 question paper
Chapter: [11] Recursion
Concept: Simple Recursive Functions (e.g. Factorial, GCD, Binary Search, Conversion of Representations of Numbers Between Different Bases)

Design a class DeciHex to accept a positive integer in decimal number system from the user and display its hexadecimal equivalent.

Example 1:

Decimal number= 25

Hexadecimal equivalent= 19

Example 2:

Decimal number =28

Hexadecimal equivalent = 1C

Some of the members of the class are given below.

Class name DeciHex
Data members/instance variables:
num stores the positive integer
hexa string to store the hexadecimal equivalent of num
Methods / Member functions:
DeciHex() constructor to initialise the data members with legal initial values
void getNum() to accept a positive integer
void convert(int n) to find the hexadecimal equivalent of the formal parameter 'n' using the recursive technique
void display() to display the decimal number and its hexadecimal equivalent by invoking the function convert()

Specify the class DeciHex giving details of the constructor( ), void getNum( ), void convert(int) and void display(). Define a main() function to create an object and call all the functions accordingly to enable the task.

Appears in 1 question paper
Chapter: [11] Recursion
Concept: Simple Recursive Functions (e.g. Factorial, GCD, Binary Search, Conversion of Representations of Numbers Between Different Bases)

Assertion: Recursion utilises more memory as compared to iteration.

Reason: Time complexity of recursion is higher due to the overhead of maintaining the function call stack.

Appears in 1 question paper
Chapter: [11] Recursion
Concept: Recursion

The following is a function of class Armstrong. This recursive function calculates and returns the sum of the cubes of all the digits of num, where num is an integer data member of the class Armstrong.

[A number is said to be Armstrong if the sum of the cubes of all its digits is equal to the original number].

There are some places in the code marked by ?1?, ?2?,?3? which may be replaced by a statement/expression so, that the function works properly.

public int sumOfPowers(int num) 
  {
     if(num == 0) 
        return ?1?
     int digit = ?2?;
        return(int)Math.pow(digit, 3) + ?3?;
}
  1. What is the expression or statement at ?1?
  2. What is the expression or statement at ?2?
  3. What is the expression or statement at ?3?
Appears in 1 question paper
Chapter: [11] Recursion
Concept: Simple Recursive Functions (e.g. Factorial, GCD, Binary Search, Conversion of Representations of Numbers Between Different Bases)

A class LCM has been defined to find the Lowest Common Multiple of two integers.

Some of the data members and member functions are given below:

Class name LCM
Data members/instance variables:
n1 to store an integer number
n2 to store an integer number
large integer to store the largest from n1,n2
sm integer to store the smallest from n1,n2
l to store lcm of two numbers
Methods / Member functions:
LCM( ) default constructor to initialize data members with legal initial values
void accept() to accept n1 and n2
int getLCM() returns the lcm of n1 and n2 using the recursive technique
void display( ) to print the numbers n1, n2 and lcm

Specify the class LCM giving details of the constructor( ), void accept( ), int getLCM() and void display( ). Define a main ( ) function to create an object and call the member functions accordingly to enable the task.

Appears in 1 question paper
Chapter: [11] Recursion
Concept: Simple Recursive Functions (e.g. Factorial, GCD, Binary Search, Conversion of Representations of Numbers Between Different Bases)
< prev  381 to 400 of 836  next > 
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×