Advertisements
Chapters
1.2: Elementary Concept of Objects and Classes
1.3: Values and Data Types
1.4: Operators in Java
1.5: Introduction to Java
1.5: Input in Java
1.6: Mathematical Library Methods
1.7: Conditional Statements in Java
1.8: Iterative Constructs in Java
1.9: Nested Loop
▶ 2: Library Classes
3: Arrays (Single Dimensional and Double Dimensional)
4: String Handling
5: User - Defined Methods
6: Class as the Basis of all Computation (Objects and Classes)
7: Constructors
8: Encapsulation and Inheritance
![Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 2 - Library Classes Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 2 - Library Classes - Shaalaa.com](/images/computer-applications-english-class-10-icse_6:1e1eb1b47d2b4696b609e5cd9260118f.jpg)
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.
Avichal solutions for Computer Applications [English] Class 10 ICSE 2 Library Classes Review Insight [Pages 175 - 176]
State the data type and value of y after the following is executed: char x = 7; y = Character.isLetter(x);
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);
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);
What will be the output when the following code segment is executed?
System.out.println(“The king said\”Begin at the beginning!\“to me.”);
Name any two wrapper classes.
Name the wrapper class of char type.
Name the wrapper class of boolean type.
State the package that contains the class:
BufferedReader
State the package that contains the class:
Scanner
What is the data type that the following library function return?
isWhiteSpace(char ch)
What is the data type that the following library function return?
Math.random( )
State the values of n and ch.
char c = 'A'
int n = c + 1;
char ch = (char)n;
State the method that converts a string to a primitive float data type.
State the method that determines, if the specified character is an upper case character.
What are library classes?
Give an example of library classes.
Write a function to check whether a character is a blank or not.
Case-Study based question (Solved):
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:
- What will be filled in the place marked with ?1?
- 65
- 82
- 90
- 122
- What will be filled in the place marked with ?2?
- b = 1; b <= a; b++
- b = a; b < 90; b++
- b = 90; b > 65; b++
- b = 65; b <= 90; b++
- What will be filled in the place marked with ?3?
- int
- char
- float
- double
- What will be filled in the place marked with ?4?
- p + 2
- p * 2
- p++
- p − 2
Avichal solutions for Computer Applications [English] Class 10 ICSE 2 Library Classes EXERCISES [Pages 177 - 180]
Multiple Choice Questions:
A package contains:
Tags
Classes
Data
Arrays
Each primitive data type belongs to a specific ______.
Block
Object
Wrapper class
None
Automatic conversion of primitive data into an object of wrapper class is called ______.
Autoboxing
Explicit conversion
Shifting
None
The parselnt() function is a member of ______.
Integer wrapper class
Character wrapper class
Boolean wrapper class
None
valueOf() function converts ______.
Primitive type to String
String to primitive type
Character to String
None
Which of the following functions checks whether a character is a blank or not?
Character.isBlankSpace()
Character.isWhiteSpace()
Character.isEmptySpace()
Character.isNull()
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.
The variable must be declared ______ type, if a character is to be assigned to it.
Char
Ch
Character
Alphanumeric
Fill in the blanks:
______ is a collection of classes.
By default, ______ package is imported in a Java program.
The user can create a data type by using a ______.
The data type int is included in ______ wrapper class.
Wrapper class uses first letter in ______ case.
String data is converted to float type by using ______ function.
Conversion from primitive type to wrapper object is called as ______.
Each character oriented function uses a wrapper tag ______.
State whether the following statements are True/False:
Java class library includes all the packages.
True
False
Wrapper classes belong to java.util package.
True
False
Array is a non-primitive data type.
True
False
Class is a composite data type.
True
False
Integer.toString() converts integer data to String.
True
False
Find the output of the following program snippet:
char ch = '*';
boolean b = Character.isLetter(ch);
System.out.println(b);
Find the output of the following program snippet:
char c = 'A';
int n = (int) c + 32;
System.out.println((char)n);
Find the output of the following program snippet:
String s= "7";
int t =lnteger.parselnt(s);
t = t + 1000;
System.out.println(t);
Find the output of the following program snippet:
char c = 'B';
inti = 4;
System.out.println(c + i);
System.out.println((int) c + i);
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);
Find the output of the following program snippet:
int n = 97;
char ch = Character.toUpperCase((char)n);
System.out.println(ch + "Great Victory");
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));
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:
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:
- What is the name given to the packet containing a primitive data type?
- What is the function used to convert a string data into integer type?
- Name the term used to convert a primitive data into the object of its wrapper class.
- What is the syntax to convert a string "24" into integer data type?
Write the purpose of the following function:
Float.parseFloat()
Write the purpose of the following function:
Double.toString()
Write the purpose of the following function:
Integer.valueOf()
Write the purpose of the following function:
Character.isDigit()
Write the purpose of the following function:
Character.isWhitespace()
Answer the following questions:
What is meant by a package?
What is the significance of '*' while importing a package?
Define a wrapper class.
Write a difference between the functions isUpperCase() and toUpperCase().
Differentiate between parselnt() and toString() functions.
Write one difference between primitive data types and composite data types.
int res = ‘A’;
What is the value of res?
Name the package that contains wrapper classes.
Write the prototype of a function check which takes an integer as an argument and returns a character.
Unsolved Programs on Character Manipulations:
Write a program in Java to input a character. Find and display the next 10th character in the ASCII table.
Write a program in Java to input a character. Display next 5 characters.
Write a program in Java to generate all the alternate letters in the range of letters from A to Z.
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.
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
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
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.
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.
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
Write a menu driven program to display
- first five uppercase letters
- last five lowercase letters as per the user's choice.
Enter 1 to display uppercase letters and enter 2 to display lowercase letters.
Using switch case statement, write a menu driven program to perform the following tasks:
- To generate and print the letters from A to Z along with their Unicode.
Letters Unicode
A 65
B 66
.......... .........
.......... .........
Z 90 - To generate and print the letters from z to a along with their Unicode.
Letters Unicode
z 122
y 121
.......... .........
.......... .........
a 97
Write a program in Java to display the following pattern:
A
ab
ABC
abcd
ABCDE
Write a program in Java to display the following pattern:
ZYXWU
ZYXW
ZYX
ZY
Z
Write a program in Java to display the following pattern:
ABCDE
ABC
A
Write a program in Java to display the following pattern:
PRTV
PRT
PR
P
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*
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
![Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 2 - Library Classes Avichal solutions for Computer Applications [English] Class 10 ICSE chapter 2 - Library Classes - Shaalaa.com](/images/computer-applications-english-class-10-icse_6:1e1eb1b47d2b4696b609e5cd9260118f.jpg)
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.