Page 153 - ComputerScience_Class_11
P. 153
4. What is the wrapper class of long data type?
a. Float b. Character
c. Double d. Long
5. Which of the following is the range of ASCII values from A to Z?
a. 97 to 122 b. 48 to 57
c. 65 to 90 d. None of these
B. Fill in the blanks.
1. ………………… literals contain two values true or false only.
2. When a variable is initialised during the execution/run time of the program, then it is known as ………………….
3. ………………… are used to set the priority of a calculation by enclosing any part of an arithmetic, logical or relational expression.
4. Arrays are the collection of elements of the same ………………… stored under a single variable name.
5. A Java program is made up of ………………….
C. Answer the following questions:
1. What do you mean by widening in implicit type conversion?
2. What is an operator? Write the names of different types of operators.
3. What is the use of \\ and \0 escape sequence?
4. What is an interface?
5. What is the size of long and byte data type in bits?
6. What are escape sequences? Explain their purpose and provide examples of some commonly used escape sequences.
7. Explain how implicit type conversion works when an int is assigned to a long variable. Provide an example to demonstrate the
process.
8. What are non-primitive data types in Java? Explain the types of non-primitive data types in detail.
9. What are wrapper classes in Java? Write a program to demonstrate the use of wrapper classes in Java.
10. Explain the process of explicit type conversion with an example.
D. Higher Order Thinking Skills (HOTS)
1. In an e-commerce platform, the total price of an order is calculated using both integer values for the price and floating-point
values for the discount. If the price of an item is ₹1,500 and the discount is 10.5%, explain how implicit type conversion works
when calculating the final price. What potential issues can arise when mixing data types in calculations and how would you
handle these issues in your program?
2. In a system that calculates the total weight of products in a warehouse, the weights are stored as long integers. If a product is
added with a weight value that exceeds the maximum limit for the long data type, explain what could happen and how type
casting can be used to handle this issue without losing data.
E. Case study-based questions.
Amit is an employee working in a software company. His monthly salary is ₹50,000 and he is eligible for a 5% performance bonus.
Amit wants to calculate his total income for the month, including the bonus.
To calculate his total income, Amit multiplies his salary by 0.05 to get his bonus amount. He then adds the bonus to his original salary
to get the total income.
Based on the given case, answer the following questions:
1. Amit's monthly salary is ₹50,000. What is the amount of the 5% performance bonus he will receive?
a. ₹1,500 b. ₹2,500
c. ₹3,000 d. ₹4,000
2. Which arithmetic operator does Amit use to calculate his performance bonus?
a. + (Addition) b. - (Subtraction)
c. * (Multiplication) d. / (Division)
Primitive Values, Wrapper Classes, Types and Casting 151

