Name the data types used to store the following data
1. ₹500
4. 10-Jan-2020
2. Rahul
S. 546
3. False
Answers
Answer:
Explanation:
Chapter 3
Values and Data Types
Class 9 - APC Understanding Computer Applications with BlueJ
Multiple Choice Questions
Question 1
A constant which gives the exact representation of data is called
Variable
Literal ✓
Identifier
Character
Question 2
A word used in a high level language which has a special meaning attached to it is called
Class
Identifier
Keyword ✓
Literal
Question 3
A character literal is assigned to a:
Char variable ✓
Char type literal
String variable
String literal
Question 4
A character literal is enclosed in:
' ' ✓
" "
: :
{ }
Question 5
A set of characters is assigned to:
String variable ✓
Static variable
Boolean variable
None
Question 6
The ASCII codes of upper case alphabets range from:
65 - 90 ✓
60 - 85
65 - 91
97 - 122
Question 7
Which of the following results in integer type?
11.4F/3.2D
13.8F/4.6F;
12/3 ✓
none
Question 8
Which of the following is non-primitive data?
char
long
object ✓
short
Question 9
Which of the following type is an exact representation of fractional values?
char
double ✓
byte
String
Question 10
Boolean Data is used to test a particular condition i.e. true or false. Which of the following is a correct representation?
boolean m=true ✓
boolean m='true'
boolean m="true"
none
Fill in the blanks
Question 1
The character sets of Java is like alphabets of English language.
Question 2
A standard encoding system way of representing characters is Unicode.
Question 3
ASCII code is decimal number to represent a character.
Question 4
Each individual component of a Java statement is known as token.
Question 5
In Java, the constants are also called literals.
Question 6
Assignment operator is used to store a value in the variable.
Question 7
The comma, exclamation, question mark etc., are termed as Separators in Java language.
Question 8
An element of Java program that is used to identify a class, function or value is called as identifier.
Question 9
Integer type value occupies 4 bytes in the memory.
Question 10
A Java expression that contains all the elements of same data type is pure expression.
Write short answers
Question 1
What do you mean by data type?
Data types are used to identify the type of data a memory location can hold and the associated operations of handling it.
Question 2
Define variable with an example.
A variable represents a memory location through a symbolic name which holds a known or unknown value of a particular data type. This name of the variable is used in the program to refer to the stored value.
Example:
int mathScore = 95;
Question 3
What do you mean by constant? Explain with an example.
The keyword final before a variable declaration makes it a constant. Its value can't be changed in the program.
Example:
final int DAYS_IN_A_WEEK = 7;
Question 4
State two kinds of data types.
Two kinds of data types are:
Primitive Datatypes.
Non-Primitive Datatypes.
Question 5
What do you understand by Token? Name different types of tokens.
A token is the smallest element of a program that is meaningful to the compiler. The different types of tokens in Java are:
Identifiers
Literals
Operators
Separators
Keywords
Question 6
What are the rules to assign a variable in a Java programming?
Name of the variable should be a sequence of alphabets, digits, underscore and dollar sign characters only.
It should not start with a digit.
It should not be a keyword or a boolean or null literal.
Question 7
Explain the term 'type casting'?
The process of converting one predefined type into another is called type casting.
Question 8
Perform the following:
(a) Assign the value of pie (3.142) to a variable with the requisite data type.
double pi = 3.142;
(b) Assign the value of (1.732) to a variable with the requisite data type.
double x = 1.732;
Question 9
Distinguish between:
(a) Integer and floating constant