English

Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 2 - Library Classes [Latest edition]

Advertisements

Chapters

Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 2 - Library Classes - Shaalaa.com
Advertisements

Solutions for Chapter 2: Library Classes

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


Review InsightEXERCISES
Review Insight [Pages 175 - 176]

Avichal solutions for Computer Applications [English] Class 10 ICSE 2 Library Classes Review Insight [Pages 175 - 176]

Review Insight | Q 1. | Page 175

State the data type and value of y after the following is executed: char x = 7; y = Character.isLetter(x); 

Review Insight | Q 2. | Page 175

Write the output of the following program code:

char ch ;
int x=97;
do
{
ch=(char) x;
System.out.print(ch + “ ” );
if(x%10 == 0)
break;
++x;
}while(x<=100);

Review Insight | Q 3. (a) | Page 175

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 3. (b) | Page 175

What will be the output when the following code segment is executed?

System.out.println(“The king said\”Begin at the beginning!\“to me.”);

Review Insight | Q 4. | Page 175

Name any two wrapper classes.

Review Insight | Q 5. (i) | Page 175

Name the wrapper class of char type. 

Review Insight | Q 5. (ii) | Page 175

Name the wrapper class of boolean type. 

Review Insight | Q 6. (a) | Page 175

State the package that contains the class:
BufferedReader

Review Insight | Q 6. (b) | Page 175

State the package that contains the class:

Scanner 

Review Insight | Q 7. (a) | Page 175

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

isWhiteSpace(char ch)

Review Insight | Q 7. (b) | Page 175

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

Math.random( )

Review Insight | Q 8. | Page 175

State the values of n and ch. 

char c = 'A'
int n = c + 1;
char ch = (char)n;

Review Insight | Q 9. (a) | Page 176

State the method that converts a string to a primitive float data type. 

Review Insight | Q 9. (b) | Page 176

State the method that determines, if the specified character is an upper case character. 

Review Insight | Q 10. (i) | Page 176

What are library classes? 

Review Insight | Q 10. (ii) | Page 176

Give an example of library classes.

Review Insight | Q 11. | Page 176

Write a function to check whether a character is a blank or not.

Case-Study based question (Solved):

Review Insight | Q 12. | Page 176

Creating a program for pattern making is an important aspect of logical development. Kunal has tried to design a program for a pattern shown alongside. But, due to some confusion, he could not complete it and has left some places blank marked with ?1?, ?2?, ?3? and ?4? to be filled with appropriate value/ expression. The program is as shown below: 

ZZZZZ
XXXX
VVV
TT
R
class Pattern
{
     public static void main()
     {
       int a, b, p;
       p = ..........?1?.........;
       for (a = 5; a >= 1; a--)
       {
          for(............?2?...............)
          System.out.print((...?3?...)p);
          System.out.println();
          p = .....?4?......;
       }
     }
}

Based on the above discussion, answer the following questions:

  1. What will be filled in the place marked with ?1?
    1. 65
    2. 82
    3. 90
    4. 122
  2. What will be filled in the place marked with ?2?
    1. b = 1; b <= a; b++
    2. b = a; b < 90; b++
    3. b = 90; b > 65; b++
    4. b = 65; b <= 90; b++
  3. What will be filled in the place marked with ?3?
    1. int
    2. char
    3. float
    4. double
  4. What will be filled in the place marked with ?4?
    1. p + 2
    2. p * 2
    3. p++
    4. p − 2
EXERCISES [Pages 177 - 180]

Avichal solutions for Computer Applications [English] Class 10 ICSE 2 Library Classes EXERCISES [Pages 177 - 180]

Multiple Choice Questions:

EXERCISES | Q I. 1. | Page 177

A package contains: 

  • Tags

  • Classes 

  • Data 

  • Arrays 

EXERCISES | Q I. 2. | Page 177

Each primitive data type belongs to a specific ______. 

  • Block

  • Object

  • Wrapper class

  • None

EXERCISES | Q I. 3. | Page 177

Automatic conversion of primitive data into an object of wrapper class is called ______.

  • Autoboxing

  • Explicit conversion

  • Shifting

  • None

EXERCISES | Q I. 4. | Page 177

The parselnt() function is a member of ______.

  • Integer wrapper class

  • Character wrapper class

  • Boolean wrapper class

  • None

EXERCISES | Q I. 5. | Page 177

valueOf() function converts ______. 

  • Primitive type to String

  • String to primitive type

  • Character to String

  • None

EXERCISES | Q I. 6. | Page 177

Which of the following functions checks whether a character is a blank or not?

  • Character.isBlankSpace()

  • Character.isWhiteSpace()

  • Character.isEmptySpace()

  • Character.isNull()

EXERCISES | Q I. 7. | Page 177

Which of the following statements is true? 

  • Character.isLowerCase() and Character.toLowerCase() are same.

  • Character.isLetter() and Character.isAlphabet() are same.

  • parse and valueOf functions are same.

  • Character.isDigit() and Character.isNumber() are same.

EXERCISES | Q I. 8. | Page 177

The variable must be declared ______ type, if a character is to be assigned to it.

  • Char

  • Ch

  • Character

  • Alphanumeric

Fill in the blanks:

EXERCISES | Q II. 1. | Page 177

______ is a collection of classes. 

EXERCISES | Q II. 2. | Page 177

By default, ______ package is imported in a Java program. 

EXERCISES | Q II. 3. | Page 177

The user can create a data type by using a ______. 

EXERCISES | Q II. 4. | Page 177

The data type int is included in ______ wrapper class. 

EXERCISES | Q II. 5. | Page 177

Wrapper class uses first letter in ______ case. 

EXERCISES | Q II. 6. | Page 177

String data is converted to float type by using ______ function.

EXERCISES | Q II. 7. | Page 177

Conversion from primitive type to wrapper object is called as ______.

EXERCISES | Q II. 8. | Page 177

Each character oriented function uses a wrapper tag ______.

State whether the following statements are True/False:

EXERCISES | Q III. 1. | Page 177

Java class library includes all the packages.

  • True

  • False

EXERCISES | Q III. 2. | Page 177

Wrapper classes belong to java.util package.

  • True

  • False

EXERCISES | Q III. 3. | Page 177

Array is a non-primitive data type. 

  • True

  • False

EXERCISES | Q III. 4. | Page 178

Class is a composite data type. 

  • True

  • False

EXERCISES | Q III. 5. | Page 178

Integer.toString() converts integer data to String. 

  • True

  • False

EXERCISES | Q IV. 1. | Page 178

Find the output of the following program snippet:

char ch = '*';
boolean b = Character.isLetter(ch);
System.out.println(b);
EXERCISES | Q IV. 2. | Page 178

Find the output of the following program snippet:

char c = 'A';
int n = (int) c + 32;
System.out.println((char)n);
EXERCISES | Q IV. 3. | Page 178

Find the output of the following program snippet:

String s= "7"; 
int t =lnteger.parselnt(s); 
t = t + 1000; 
System.out.println(t);
EXERCISES | Q IV. 4. | Page 178

Find the output of the following program snippet:

char c = 'B'; 
inti = 4;  
System.out.println(c + i); 
System.out.println((int) c + i); 
EXERCISES | Q IV. 5. | Page 178

Find the output of the following program snippet:

char ch= 'y'; 
char chr = Character.toUpperCase(ch); 
int p = (int) chr; 
System.out.println(chr+ "\t" + p);
EXERCISES | Q IV. 6. | Page 178

Find the output of the following program snippet:

int n = 97; 
char ch = Character.toUpperCase((char)n); 
System.out.println(ch + "Great Victory");
EXERCISES | Q IV. 7. | Page 178

Find the output of the following program snippet:

char ch = 'x'; int n = 5; 
n = n + (int)ch; 
char c = (char)n; 
System.out.println((char)((int)c-26)); 
EXERCISES | Q IV. 8. | Page 178

Find the output of the following program snippet:

char ch = 'A'; 
char chr = Character.toLowerCase(ch); 
int n = (int)chr - 32; 
System.out.println(Char)n + "\t" + chr); 

Case-Study based question:

EXERCISES | Q V. | Page 178

Java language uses each primitive data type under a specific packet. Other than a data type, the packet also contains the functions to convert the primitive type into string and vice versa. The computer uses 128 ASCII characters. Each character is assigned a specific numeric code called ASCII code. Java language also has the facility to convert the characters into the ASCII code and vice versa. 

Based on the above discussion, answer the following questions:

  1. What is the name given to the packet containing a primitive data type?
  2. What is the function used to convert a string data into integer type?
  3. Name the term used to convert a primitive data into the object of its wrapper class.
  4. What is the syntax to convert a string "24" into integer data type?
EXERCISES | Q VI. 1. | Page 178

Write the purpose of the following function:

Float.parseFloat() 

EXERCISES | Q VI. 2. | Page 179

Write the purpose of the following function:

Double.toString()

EXERCISES | Q VI. 3. | Page 179

Write the purpose of the following function:

Integer.valueOf()

EXERCISES | Q VI. 4. | Page 179

Write the purpose of the following function:

Character.isDigit()

EXERCISES | Q VI. 5. | Page 179

Write the purpose of the following function:

Character.isWhitespace()

Answer the following questions:

EXERCISES | Q VII. 1. | Page 179

What is meant by a package? 

EXERCISES | Q VII. 2. | Page 179

What is the significance of '*' while importing a package? 

EXERCISES | Q VII. 3. | Page 179

Define a wrapper class. 

EXERCISES | Q VII. 4. (a) | Page 179

Write a difference between the functions isUpperCase() and toUpperCase().

EXERCISES | Q VII. 4. (b) | Page 179

Differentiate between parselnt() and toString() functions.

EXERCISES | Q VII. 4. (c) | Page 179

Write one difference between primitive data types and composite data types.

EXERCISES | Q VII. 5. (a) | Page 179

int res = ‘A’; 

What is the value of res?

EXERCISES | Q VII. 5. (b) | Page 179

Name the package that contains wrapper classes. 

EXERCISES | Q VII. 5. (c) | Page 179

Write the prototype of a function check which takes an integer as an argument and returns a character.

Unsolved Programs on Character Manipulations:

EXERCISES | Q VIII. 1. | Page 179

Write a program in Java to input a character. Find and display the next 10th character in the ASCII table. 

EXERCISES | Q VIII. 2. | Page 179

Write a program in Java to input a character. Display next 5 characters. 

EXERCISES | Q VIII. 3. | Page 179

Write a program in Java to generate all the alternate letters in the range of letters from A to Z. 

EXERCISES | Q VIII. 4. | Page 179

Write a program to input a set of 20 letters. Convert each letter into uppercase. Find and display the number of vowels and number of consonants present in the set of given letters. 

EXERCISES | Q VIII. 5. | Page 179

Write a program in Java to accept an integer number N such that 0<N<27. Display the corresponding letter of the alphabet (i.e., the letter at position N).

Hint: If N = 1 then display A 

EXERCISES | Q VIII. 6. | Page 179

Write a program to input two characters from the keyboard. Find the difference (d) between their ASCII codes. Display the following messages: 

If d = 0: both the characters are same.
If d < 0: first character is smaller.
If d > 0: second character is smaller.
Sample Input: D
                       P
Sample Output: d = (68 − 80) = −12
                          First character is smaller

EXERCISES | Q VIII. 7. | Page 179

Write a program to input a set of any 10 integer numbers. Find the sum and product of the numbers. Join the sum and product to form a single number. Display the concatenated number. 

Hint: let sum = 245 and product = 1346 then the number after joining sum and product will be 2451346. 

EXERCISES | Q VIII. 8. | Page 179

Write a menu driven program to generate the uppercase letters from Z to A and lowercase letters from a to z as per the user's choice. Enter 1 to display uppercase letters from Z to A and Enter 2 to display lowercase letters from a to z.

EXERCISES | Q VIII. 9. | Page 179

Write a program to input a letter. Find its ASCII code. Reverse the ASCII code and display the equivalent character.

Sample Input: Y
Sample Output: ASCII Code = 89
Reverse the code = 98
Equivalent character: b

EXERCISES | Q VIII. 10. | Page 180

Write a menu driven program to display

  1. first five uppercase letters
  2. last five lowercase letters as per the user's choice.
    Enter 1 to display uppercase letters and enter 2 to display lowercase letters. 
EXERCISES | Q VIII. 11. | Page 180

Using switch case statement, write a menu driven program to perform the following tasks:

  1. To generate and print the letters from A to Z along with their Unicode. 
    Letters                              Unicode
    A                                        65
    B                                        66
    ..........                                  .........
    ..........                                  .........
    Z                                        90
  2. To generate and print the letters from z to a along with their Unicode.
    Letters                               Unicode
    z                                          122
    y                                          121
    ..........                                    .........
    ..........                                    .........
    a                                          97
EXERCISES | Q VIII. 12. (a) | Page 180

Write a program in Java to display the following pattern:

A
ab
ABC
abcd
ABCDE 

EXERCISES | Q VIII. 12. (b) | Page 180

Write a program in Java to display the following pattern:

ZYXWU
ZYXW
ZYX
ZY
Z

EXERCISES | Q VIII. 12. (c) | Page 180

Write a program in Java to display the following pattern:

ABCDE
ABC
A

EXERCISES | Q VIII. 12. (d) | Page 180

Write a program in Java to display the following pattern:

PRTV
PRT
PR
P

EXERCISES | Q VIII. 12. (e) | Page 180

Write a program in Java to display the following pattern:

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

EXERCISES | Q VIII. 12. (f) | Page 180

Write a program in Java to display the following pattern:

a a a a a 
b b b b b 
A A A A A 
B B B B B 

Solutions for 2: Library Classes

Review InsightEXERCISES
Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 2 - Library Classes - Shaalaa.com

Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 2 - Library Classes

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 2 (Library Classes) 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 2 Library Classes are Primitive Data Type and Composite Data Type, Wrapper Classes, Methods of Wrapper Class, Autoboxing and Unboxing in Wrapper Classes, Introduction of Library Classes, Character type data.

Using Avichal Computer Applications [English] Class 10 ICSE solutions Library Classes 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 2, Library Classes 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×