ISC Class 12th Computer Science Chapter 9 - Arrays, Strings Important Questions with Answers

You should focus on solving ISC Class 12th Computer Science Chapter 9: Arrays, Strings important questions, especially to help you score high marks. By solving ISC Class 12th Computer Science 9 questions, you will be solving exam-oriented questions only.
examUpdate

Never Miss an Exam Update

Prepare thoroughly with the most important questions of ISC Class 12th Computer Science Chapter 9 - Arrays, Strings. You can first cover the ISC Class 12th Computer Science syllabus to understand the key topics and then start solving the ISC Class 12th Computer Science Chapter 9 - Arrays, Strings Important Question to get a better understanding of your preparation level. Start practicing now.

Are you feeling lost and unsure about what career path to take after completing 12th standard?

Say goodbye to confusion and hello to a bright future!

news_cta
Read More
/cisce-board-class-12-computer-science-chapter-9-arrays-strings-important-questions-brd

Question 1.

img
int Toy(int n)
{ return (n<=0)? 1: n%10 + Toy(n/10); }

With reference to the program code given above, what will the function Toy() return when the value of n = 56?

Question 2.

img

Write the statement in Java to extract the word “MISS” from the word “SUBMISSION”.

Question 3.

img

What is the output of the statement given below?

System.out.print("FAN" + ("AUTOMATIC".charAt(5) ) );

Question 4.

img

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 nameCheck
Data members/instance variables:
wrdstores a word
lento 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.

Question 5.

img

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 nameToggle
Data members/instance variables:
strstores a word
newstrstores the toggled word
lento 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.

Question 6.

img

State any one use of interfaces in Java.

Question 7.

img

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.

Question 8.

img

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.

Question 9.

img

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.

Question 10.

img

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?

Great Job! continue working on more practice questions?

Question 1.

img

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 nameStringOp
Data members/instance variables:
strto store the original string
mskto store the mask string
nstrto 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.

Question 2.

img

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 nameMixarray
Data members/instance variables:
arr[]integer array
capinteger 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.

Other CISCE Board Class 12th Computer Science Chapter Wise Questions

Other CISCE Board Class 12th Subjects Important Questions

Do you have a question? Ask us.

  • Typical response between 24-48 hours

  • Get personalized response

  • Free of Cost

  • Access to community

Trending Articles