English

Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 4 - String Handling [Latest edition]

Advertisements

Chapters

Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 4 - String Handling - Shaalaa.com
Advertisements

Solutions for Chapter 4: String Handling

Below listed, you can find solutions for Chapter 4 of CISCE Avichal for Computer Applications [English] Class 10 ICSE.


Review InsightEXERCISES
Review Insight [Pages 284 - 285]

Avichal solutions for Computer Applications [English] Class 10 ICSE 4 String Handling Review Insight [Pages 284 - 285]

Review Insight | Q 1. | Page 284

State the output of the following program segment.

String s = "Examination"; 
int n = s.length(); 
System.out.println(s.starts With(s.substring(5 ,n))); 
System.out.println(s.charAt(2) == s.charAt(6));
Review Insight | Q 2. | Page 284

State the data type and values of a and b after the following segment is executed.

String s1 = "Computer",  s2 = "Applications"; 
a = (s1.compareTo (s2)); 
b = (s1.equals (s2));
Review Insight | Q 3. | Page 284

What will be the output of the following code? 

String s = "malayalam"; 
System.out.println(s.indexOf('m')); 
System.out.println(s.lastlndexOf('m'));
Review Insight | Q 4. | Page 284

Write a statement to show how finding the length of a character array chr[ ] differs from finding the length of String object str. 

Review Insight | Q 5. | Page 284

State the values stored in the variable str1 and str2.

String s1 = "good"; String s2 = "world matters";
String str1 = s2.substring(5).replace('t', 'n').
String str2 = s1.concat(strl1);  

Review Insight | Q 6. (i) | Page 284

What is the data type that the following library function return?

isWhiteSpace(char ch)

Review Insight | Q 6. (ii) | Page 284

What is the data type that the following library function return?

Math.random( )

Review Insight | Q 7. | Page 284

State the output of the following program segment:

String str1 = "great"; String str2 = "minds"; 
System.out.println(str1.substring(0,2).concat(str2.substring(1))); 
Systern.out.println(("WH" + (str1.substring(2).toUpperCase()))); 
Review Insight | Q 8. (i) | Page 284

What is the data type returned by the library function?
compareTo()

Review Insight | Q 8. (ii) | Page 284

What is the data type returned by the library function?

equals()

Review Insight | Q 9. | Page 285

State the value of characteristic and mantissa when the following code is executed:
String s = “4.3756”;
int n = s.indexOf(‘.’);
int characteristic=Integer.parseInt (s.substring (0,n));
int mantissa=Integer.valueOf(s.substring(n+1)); 

Review Insight | Q 10. | Page 285

What will be the output when the following code segment is  executed?
String s = “1001”;
int x = Integer. valueOf(s);
double y = Double.valueOf(s);
System.out.println(“x=”+x);
System.out.println(“y=”+y); 

Review Insight | Q 11. | Page 285

What is the value stored in variable res given below?

double res = Math.pow (“345”.indexOf(‘5’), 3);

Review Insight | Q 12. | Page 285

State the output when the following program segment is executed:

String a = "Smartphone", b = "Graphic Art"; 
String h = a.substring(2, 5); 
String k = b.substring(S).toUpperCase(); 
System.out.println(h); 
System.out.println(k.equalsignoreCase(h)); 
Review Insight | Q 13. | Page 285

Name a string function which removes the blank spaces provided in the prefix and suffix of a string. 

Review Insight | Q 14. | Page 285

State the difference between == operator and equals () method. 

Review Insight | Q 15. | Page 285

Give the output of the following string functions:

  1. "MISSISSIPPI".indexOf('S') + "MISSISSIPPI".lastIndexOf('I')
  2. "CABLE".compareTo("CADET") 
Review Insight | Q 16. | Page 285

Write the return type of the following library functions: 

  1. isLetterOrDigit(char)
  2. replace(char, char) 
Review Insight | Q 17. | Page 285

You can use a variable to store a set of characters enclosed within opening and closing double quotes. A set of characters can also be stored in an object using a specific keyword. Such data are manipulated using different functions. One of them is used to extract a set of characters from such data whereas, other to join multiple set of characters to form a single set.  

Based on the above discussion, answer the following questions:

  1. Which of the following variables is used to store a set of characters?
    1. Character variable
    2. Alphanumeric variable
    3. String variable
    4. Local variable
  2. Which of the following keywords is used to store a set of characters in an object?
    1. import
    2. oublic
    3. string
    4. new
  3. Which of the following functions is used to extract a set of characters?
    1. substring() 
    2. charAt() 
    3. indexOf()
    4. subIndex()
  4. Which of the following functions is used to join different set of characters into a single set?
    1. merge()
    2. concat()
    3. connect()
    4. join
EXERCISES [Pages 286 - 293]

Avichal solutions for Computer Applications [English] Class 10 ICSE 4 String Handling EXERCISES [Pages 286 - 293]

Multiple Choice Questions:

EXERCISES | Q I. 1. | Page 286

A string is: 

  • A set of letters

  • A set of letters and digits

  • A set of letters, digits and special characters

  • All the above 

EXERCISES | Q I. 2. | Page 286

A string internally creates:

  • An integer array

  • A numeric array

  • A character array 

  • A double type array 

EXERCISES | Q I. 3. | Page 286

If a string contains 12 characters, what will be the index of the last character?

  • 12

  • 11

  • 10

  • 0

EXERCISES | Q I. 4. | Page 286

What will be the value stored in the variable 'c' if the following statement is executed? 

c = "COMPUTER".charAt("COMPUTER".indexOf('P')) 

  • 3

  • 4

  • P

  • M

EXERCISES | Q I. 5. | Page 286

Which of the following functions is used to remove leading and trailing white spaces from the string? 

  • trim()

  • trail()

  • truncate()

  • slice()

EXERCISES | Q I. 6. | Page 286

What will be the output of the following program snippet? 

s1 = "COMPUTER"
s2 = "computer" 
System.out.println(s1.equals(s2)); 

  • True

  • False

  • 0

  • 1

EXERCISES | Q I. 7. | Page 286

What will be the output of the following program snippet? 

strl = "AMAN"8
str2 = "AMIT"
System.out.println(strl.compareTo(str2));

  • 8

  • 0

  • −8

  • 2

EXERCISES | Q I. 8. | Page 287

Which of the following packages contain string functions?

  • java.awt

  • java.string

  • java.math

  • java.lang

Fill in the blanks:

EXERCISES | Q II. 1. | Page 287

______ method is used to join two strings. 

EXERCISES | Q II. 2. | Page 287

The output of the following statement, when executed:

System.out.println("COMPUTER".charAt(4)); is ______.

EXERCISES | Q II. 3. | Page 287

The output of the statement, when executed: 

System.out.println("Object Oriented".length()); is ______.

EXERCISES | Q II. 4. | Page 287

______ operator is used to concatenate two strings. 

EXERCISES | Q II. 5. | Page 287

String declaration is terminated by the symbol ______.

EXERCISES | Q II. 6. | Page 287

Character literal is enclosed within ______.

EXERCISES | Q II. 7. | Page 287

The return type of the statement equals() is ______.

EXERCISES | Q II. 8. | Page 287

The output of "VIDYALAYA."substring(2,5) will result in ______.

EXERCISES | Q III. 1. | Page 287

Write down the syntax to perform the following task:

To check whether a character(chr) is in uppercase or not.

EXERCISES | Q III. 2. | Page 287

Write down the syntax to perform the following task:

To compare whether two Strings(str1, str2) are same or not.

EXERCISES | Q III. 3. | Page 287

Write down the syntax to perform the following task:

To extract the last character of a word(wd) stored in the variable chr.

EXERCISES | Q III. 4. | Page 287

Write down the syntax to perform the following task:

To return the first occurrence of 'a' in the word "applications".

EXERCISES | Q III. 5. | Page 287

Write down the syntax to perform the following task:

To replace the word "old" with the word "new" in a given String st = "old is always old".

EXERCISES | Q III. 6. | Page 287

Write down the syntax to perform the following task:

To check if the second character of a String(str) is in uppercase.

EXERCISES | Q IV. 1. | Page 287

Predict the output of the following:

String str = "Computer Applications" + 1 + 0;
System.out.println("Understanding" + str);
EXERCISES | Q IV. 2. | Page 287

Predict the output of the following:

String n1 = "46", n2 = "64"; 
int total = Integer.parselnt(n1) + Integer.parselnt(n2); 
System.out.println("The sum of " + "46" + "and" + " 64" + "is" + total); 
EXERCISES | Q IV. 3. | Page 287

Predict the output of the following:

boolean p; 
p = ("BLUEJ".length() > "bluej".length()) ? true: false;
EXERCISES | Q IV. 4. | Page 287

Predict the output of the following:

String str = "Information Technology"; 
int p; 
p = str.indexOf('n'); 
System.out.println(p); 
EXERCISES | Q IV. 5. | Page 287

Predict the output of the following:

String str1 = "Information Technology"; 
String str2 = "information technology"; 
boolean p = str1.equalsignoreCase(str2); 
System.out.println("The result is" + p ); 
EXERCISES | Q IV. 6. | Page 287

What do the following functions return? 

String x = "Vision";
String y = "2020";

  1. System.out.println(x + y);
  2. System.out.printh1(x.length ());
  3. System.out.println(x.charAt(3));
  4. System.out.println(x.equals(y)); 
EXERCISES | Q IV. 7. | Page 288

Predict the output of the following:

String S1 = "Computer World"; 
String S2 = "COMPUTER WORLD"; 
String S3 = "Computer world"; 
String S4 = "computer world"; 
System.out.println(S1 + "equals"+ S2 + " " + S1.equals(S2)); 
System.out.println(S1 + "equals"+ S3 + " " + S1.equals(S3)); 
System.out.println(S1 + "equals"+ S4 + " " + S1.equals(S4)); 
System.out.println(S1 + "equalslgnoreCase"+ S4 + " " + S1.equalslgnoreCase(S4)); 
EXERCISES | Q IV. 8. | Page 288

If String x = "Computer";
String y = "Applications";

What do the following functions return?

  1. System.out. println(x.substring(1,5));
  2. System.out.println(x.indexOf(x.charAt(4)));
  3. System.out.println(y + x.substring(5));
  4. System.out.println(x.equals(y)); 
EXERCISES | Q IV. 9. | Page 288

Give the output of the following: 

String n = "Computer Knowledge";
String m = "Computer Applications”;
System.out.println(n.substring(0,8).concat(m.substring(9)));
System.out.println(n.endsWith("e"));
EXERCISES | Q IV. 10. | Page 288

String x[] = {“SAMSUNG”, “NOKIA”, “SONY”, “MICROMAX”, “BLACKBERRY”};

Give the output of the following statements:

  1. System.out.println(x[1]);
  2. System.out.println(x[3].length()); 
EXERCISES | Q IV. 11. | Page 288

Give the output of the following string functions: 

  1. “ACHIEVEMENT”.replace(E’, ‘A’)
  2. “DEDICATE”.compareTo(“DEVOTE”)
EXERCISES | Q IV. 12. | Page 288

Consider the following String array and give the output.

String arr[]= {"DELHI'', "CHENNAI", "MUMBAI", "LUCKNOW", "JAIPUR"}; 
System.out.println(arr[O].length() > arr[3].length()); 
System.out.print(arr[4].substring(0, 3));

Case-Study based question:

EXERCISES | Q V. | Page 288

Your friend is trying to write a program to find and display the frequency of vowels in a string. Due to confusion in the syntax of some of the statements, he could not complete the program and has left some places blank marked with ?1?, ?2?, ?3? and ?4? to be filled with expression/function. The incomplete program is shown below: 

import java.util.*;
class Vowels
{
public static void main(String args[])
    {
      Scanner ...?1?...=new Scanner(System.in);
      String st;
      int i, b, v = 0;
      char chr;
      System.out.println(“Enter a string”);
      st=...........?2?............; // to input a string
      st=..............?3?.............; // to convert the string into uppercase
      b = st.length();
      for (i = 0; i < b; i++)
        {
        chr= ......?4?......; // to extract a character
        if (chr == "A" || chr == "E" || chr == "T" || chr == "0" || chr == "U")
          v = v + 1;
        }
      System.out.printIn(“No. of Vowels = “ + v);
    }
}

Based on the above discussion, answer the following questions:

  1. What expression / function will be filled in place of ?1?
  2. What expression /function will be filled in place of ?2?
  3. What expression /function will be filled in place of ?3?
  4. What expression /function will be filled in place of ?4?
EXERCISES | Q VI. 1. | Page 289

Differentiate between equals() and ==

EXERCISES | Q VI. 2. | Page 289

Differentiate between compareTo() and equals().

EXERCISES | Q VI. 3. | Page 289

Differentiate between toLowerCase() and toUpperCase().

EXERCISES | Q VI. 4. | Page 289

Differentiate between charAt() and substring().

Write short answers:

EXERCISES | Q VII. 1. (i) | Page 289

What is exception?

EXERCISES | Q VII. 1. (ii) | Page 289

Name two exception handling blocks.

EXERCISES | Q VII. 2. (a) | Page 289

State the purpose and return data type of the following String function:

indexOf() 

EXERCISES | Q VII. 2. (b) | Page 289

State the purpose and return data type of the following String function:

compareTo() 

EXERCISES | Q VII. 3. (i) | Page 289

Write a statement to perform the following task on a string:

Extract the second last character of a word stored in the variable wd.

EXERCISES | Q VII. 3. (ii) | Page 289

Write a statement to perform the following task on a string:

Check if the second character of a string str is in uppercase.

EXERCISES | Q VII. 4. (i) | Page 289

Write a statement to perform the following task on a string:

Find and display the position of the last space in a string s.

EXERCISES | Q VII. 4. (ii) | Page 289

Write a statement to perform the following task on a string:

Convert a number stored in a string variable x to double data type.

EXERCISES | Q VII. 5. | Page 289

How does endsWith() and startsWith() differ? Explain with an example.

EXERCISES | Q VIII. 1. | Page 289

Describe the purpose of the following function with its syntax:

toUpperCase() 

EXERCISES | Q VIII. 2. | Page 289

Describe the purpose of the following function with its syntax:

trim()

EXERCISES | Q VIII. 3. | Page 289

Describe the purpose of the following function with its syntax:

toLowerCase()

EXERCISES | Q VIII. 4. | Page 289

Describe the purpose of the following function with its syntax:

length() 

EXERCISES | Q VIII. 5. | Page 289

Describe the purpose of the following function with its syntax:

replace()

EXERCISES | Q VIII. 6. | Page 289

Describe the purpose of the following function with its syntax:

compareTo()

EXERCISES | Q VIII. 7. | Page 289

Describe the purpose of the following function with its syntax:

reverse()

EXERCISES | Q VIII. 8. | Page 289

Describe the purpose of the following function with its syntax:

indexOf()

EXERCISES | Q VIII. 9. | Page 289

Describe the purpose of the following function with its syntax:

startWith()

EXERCISES | Q VIII. 10. | Page 289

Describe the purpose of the following function with its syntax:

equalsignoreCase()

Unsolved Java Programming based on Strings:

EXERCISES | Q IX. 1. | Page 289

Write a program to input a sentence. Find and display the following:

  1. Number of words present in the sentence
  2. Number of letters present in the sentence

Assume that the sentence neither includes any digit nor any special character.

EXERCISES | Q IX. 2. | Page 289

Write a program in Java to accept a word / a String and display the new string after removing all the vowels present in it. 

Sample Input: COMPUTER APPLICATIONS
Sample Output: CMPTR PPLCTNS 

EXERCISES | Q IX. 3. | Page 290

Write a program in Java to accept a name (Containing three words) and Display only the initials (i.e., first letter of each word). 

Sample Input: LAL KRISHNA ADVANI
Sample output: L K A 

EXERCISES | Q IX. 4. | Page 290

Write a program in Java to accept a name containing three words and display the surname first, followed by the first and middle names.

Sample Input: MOHANDAS KARAMCHAND GANDHI
Sample output: GANDHI MOHANDAS KARAMCHAND 

EXERCISES | Q IX. 5. | Page 290

Write a program in Java to enter a String/Sentence and display the longest word and the length of the longest word present in the String.

Sample Input: "TATA FOOTBALL ACADEMY WILL PLAY AGAINST MOHAN BAGAN"
Sample output: The longest word: FOOTBALL: The length of the word: 8

EXERCISES | Q IX. 6. | Page 290

Write a program in Java to accept a word and display the ASCII code of each character of the word.

Sample Input: BLUEJ
Sample output: ASCII of B = 66
                           ASCII of L = 75
                           ASCII of U = 84
                           ASCII of E = 69
                           ASCII of J = 73

EXERCISES | Q IX. 7. | Page 290

Write a program in Java to accept a String in uppercase and replace all the vowels present in the String with Asterisk (*) sign.

Sample Input: "TATA STEEL IS IN JAMSHEDPUR"
Sample output: T*T* ST**L *S *N J*MSH*DP*R 

EXERCISES | Q IX. 8. | Page 290

Write a program in Java to enter a sentence. Frame a word by joining all the first characters of each word of the sentence. Display the word.

Sample Input: Vital Information Resource Under Seize
Sample Output: VIRUS

EXERCISES | Q IX. 9. | Page 290

Write a program in Java to enter a sentence. Display the words which are only palindrome.

Sample Input: MOM AND DAD ARE NOT AT HOME
Sample Output: MOM
                            DAD

EXERCISES | Q IX. 10. | Page 290

Write a program to accept a sentence. Display the sentence in reversing order of its word.

Sample Input: Computer is Fun
Sample Output: Fun is Computer

EXERCISES | Q IX. 11. | Page 290

Write a program to input a sentence and display the word of the sentence that contains maximum number of vowels.

Sample Input: HAPPY NEW YEAR
Sample Output: The word with maximum number of vowels: YEAR

EXERCISES | Q IX. 12. | Page 290

Consider the sentence as given below:
Blue bottle is in Blue bag lying on Blue carpet

Write a program to assign the given sentence to a string variable. Replace the word Blue with Red at all its occurrences. Display the new string as shown below:
Red bottle is in Red bag lying on Red carpet 

EXERCISES | Q IX. 13. | Page 290

Write a program to accept a word and convert it into lowercase, if it is in uppercase. Display the new word by replacing only the vowels with the letter following it.

Sample Input: computer
Sample Output: cpmpvtfr

EXERCISES | Q IX. 14. | Page 291

Write a program to input a sentence. Create a new sentence by replacing each consonant with the previous letter. If the previous letter is a vowel then replace it with the next letter (i.e., if the letter is B then replace it with C as the previous letter of B is A). Other characters must remain same. Display the new sentence.

Sample Input: ICC WORLD CUP
Sample Output: IBB VOQKC BUQ 

EXERCISES | Q IX. 15. | Page 291

A 'Happy Word' is defined as:

Take a word and calculate the word's value based on position of the letters in English alphabet. On the basis of word's value, find the sum of the squares of its digits. Repeat the process with the resultant number until the number equals 1 (one). If the number ends with 1 then the word is called a 'Happy Word'. Write a program to input a word and check whether it a 'Happy Word' or not. The program displays a message accordingly.

Sample Input: VAT
Place value of V = 22, A = 1, T = 20
[Hint: A = 1, B = 2, ---------------------------, Z = 26]
Solution: 22120 ⇒ 22 + 22 + 12 + 22 + 02 = 13 ⇒ 12 + 32 = 10 ⇒ 12 + 02 = 1
Sample Output: A Happy Word

EXERCISES | Q IX. 16. | Page 291

Write a program to input a sentence. Count and display the frequency of each letter of the sentence in alphabetical order.

Sample Input: COMPUTER APPLICATIONS
Sample Output: 

Character Frequency Character Frequency
A 2 O 2
C 2 P 3
I 1 R 1
L 2 S 1
M 1 T 2
N 1 U 1
EXERCISES | Q IX. 17. | Page 291

Write a program to accept a string. Convert the string into uppercase letters. Count and output the number of double letter sequences that exist in the string. 

Sample Input: "SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE"
Sample Output: 4

EXERCISES | Q IX. 18. | Page 291

Special words are those words that start and end with the same letter.
Examples:
EXISTENCE
COMIC
WINDOW
Palindrome words are those words which read the same from left to right and vice versa
Examples:
MALAYALAM
MADAM
LEVEL
ROTATOR
CIVIC
All palindromes are special words, but all special words are not palindromes. Write a program to accept a word check and print Whether the word is a palindrome or only a special word.

EXERCISES | Q IX. 19. | Page 291

Write a program to input a sentence. Convert the sentence into uppercase letters. Display the words along with frequency of the words which have at least a pair of consecutive letters.

Sample Input: MODEM IS AN ELECTRONIC DEVICE
Sample Output: 
                   MODE
                   DEVICE
Number of words containing consecutive letters: 2

EXERCISES | Q IX. 20. | Page 292

Write a programme to accept a word (say, BLUEJ) and display the pattern: 

  1. B L U E J
    B L U E
    B L U
    B L
    B
  2. J
    E E
    U U U
    L  L  L  L
    B B B B B
  3. B L U E J
    L U E J
    U E J
    E J
    j
EXERCISES | Q IX. 21. | Page 292

Write a program to display the pattern: 

  1. A B C D E
    B C D E
    C D E
    D E
    E

  2. B C
    D E F
    G H I J
    K L M N O
  3. A B C D E
    A B C D A 
    A B C A B 
    A B A B C
    A A B C D
EXERCISES | Q IX. 22 | Page 292

Write a program to generate a triangle or an inverted triangle till n terms based upon the User's choice of the triangle to be displayed.

Example1: Example2:
Input: Type 1 for a triangle and Type 2 for an inverted triangle Enter your choice 1 Enter the number of terms 5 Input: Type 1 for a triangle and Type 2 for an inverted triangle of alphabets Enter your choice 2 Enter the number of terms 5

Sample Output:

     * * * * *
       * * * *
         * * *
           * *
             *

Sample Output:

A B C D E
A B C D
A B C
A B
A

EXERCISES | Q IX. 23. | Page 292

Write a program to generate a triangle or an inverted choice. triangle based upon User's choice.

Example 1: Example 2:
Input: Type 1 for a triangle and Type 2 for an inverted triangle Enter your choice 1 Enter a word: BLUEJ Input: Type 1 for a triangle and Type 2 for an inverted triangle Enter your choice 2 Enter a word: BLUEJ

Sample Output: 


L  L
U U U 
E  E  E  E
J  J  J  J  J 

Sample Output: 

B L U E J
B L U E
B L U 
B L 
B

EXERCISES | Q IX. 24. | Page 292

Using the switch statement, write a menu-driven program for the following: 

(i) To print Floyd’s triangle [Given below]

1

2      3

4      5       6

7      8       9      10

11    12    13     14    15

(ii) To display the following pattern:

I

I     C

I     C      S

I     C      S     E

For an incorrect option, an appropriate error message should be displayed. 

EXERCISES | Q IX. 25. | Page 293

Write a program in Java to store 10 different country names and their capitals in two different Single Dimensional Arrays (SDA). Display the country names (that starts with a vowel) along with their capitals in the given format. 

Country Names Capital
x x x x x x x x
x x x x  x x x x
EXERCISES | Q IX. 26. | Page 293

Write a program in Java to store 20 different names and telephone numbers of your friends in two different Single Dimensional Arrays (SDA). Now arrange all the names in alphabetical order and display all the names along with their respective telephone numbers use selection sort technique.

Write a program to accept 10 names in a Single Dimensional Array (SDA). Display the names whose first letter matches with the letter entered by the user.

Sample Input: Aman Shahi
Akash Gupta
Suman Mishra and so on --------
Sample Output: Enter a letter
                            A
                            Aman Shahi
                            Akash Gupta
                            --------------

EXERCISES | Q IX. 27. | Page 293

Write a program to input twenty names in an array. Arrange these names in ascending order of letters, using the bubble sort technique.

Sample Input:
Rohit, Devesh, Indrani, Shivangi, Himanshu, Rishi, Piyush, Deepak, Abhishek, Kunal
Sample Output:
Abhishek, Deepak, Devesh, Himanshu, lndrani, Kunal, Piyush, Rishi, Rohit, Shivangi 

EXERCISES | Q IX. 28. | Page 293

Write a program in Java to input the names of 10 cities in a Single Dimensional Array. Display only those names which begin with a consonant but end with a vowel. 

Sample Input: Kolkata, Delhi, Bengaluru, Jamshedpur, Bokaro, .............
Sample Output: Kolkata
                            Delhi
                            Bengaluru
                            Bokaro
                            .......................
                            .......................

EXERCISES | Q IX. 29. | Page 293

Write a program in Java to store 10 words in a Single Dimensional Array. Display only those words which are Palindrome. 

Sample Input: MADAM, TEACHER, SCHOOL, ABBA, ................
Sample Output: MADAM
                            ABBA
                            .................
                            .................

EXERCISES | Q IX. 30. | Page 293

Write a program to accept the names of 10 cities in a single dimensional string array and their STD (Subscribers Trunk Dialling) codes in another single dimension integer array. Search for the name of a city input by the user in the list. If found, display "Search Successful" and print the name of the city along with its STD code, or else display the message "Search unsuccessful, no such city in the list". 

Solutions for 4: String Handling

Review InsightEXERCISES
Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 4 - String Handling - Shaalaa.com

Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 4 - String Handling

Shaalaa.com has the CISCE Mathematics Computer Applications [English] Class 10 ICSE CISCE solutions in a manner that help students grasp basic concepts better and faster. The detailed, step-by-step solutions will help you understand the concepts better and clarify any confusion. Avichal solutions for Mathematics Computer Applications [English] Class 10 ICSE CISCE 4 (String Handling) include all questions with answers and detailed explanations. This will clear students' doubts about questions and improve their application skills while preparing for board exams.

Further, we at Shaalaa.com provide such solutions so students can prepare for written exams. Avichal textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.

Concepts covered in Computer Applications [English] Class 10 ICSE chapter 4 String Handling are Concept of String Class, String Functions, StringBuffer Functions.

Using Avichal Computer Applications [English] Class 10 ICSE solutions String Handling exercise by students is an easy way to prepare for the exams, as they involve solutions arranged chapter-wise and also page-wise. The questions involved in Avichal Solutions are essential questions that can be asked in the final exam. Maximum CISCE Computer Applications [English] Class 10 ICSE students prefer Avichal Textbook Solutions to score more in exams.

Get the free view of Chapter 4, String Handling Computer Applications [English] Class 10 ICSE additional questions for Mathematics Computer Applications [English] Class 10 ICSE CISCE, and you can use Shaalaa.com to keep it handy for your exam preparation.

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×