English

Dheeraj Mehrotra solutions for Computer Science [English] Class 12 chapter 6 - Variables and Expressions [Latest edition]

Chapters

    1: Boolean Algebra

    2: Computer Hardware

    3: Programming in Java (Review of Class XI Sections B and C)

    4: Objects

    5: Primitive Values, Wrapper Classes, Types and Casting

▶ 6: Variables and Expressions

   Chapter 7: Statements and their Scope

   Chapter 8: Methods

   Chapter 9: Arrays and Strings in Java

   Chapter 10: Recursion in Java

   Chapter 11: Inheritance and Polymorphism

   Chapter 12: Data Structures

   Chapter 13: Complexity and Big O Notation

   Chapter 14: Practical Programs (Solved and UnSolved)

Dheeraj Mehrotra solutions for Computer Science [English] Class 12 chapter 6 - Variables and Expressions - Shaalaa.com
Advertisements
Advertisements

Solutions for Chapter 6: Variables and Expressions

Below listed, you can find solutions for Chapter 6 of CISCE Dheeraj Mehrotra for Computer Science [English] Class 12.


EXERCISE
Advertisements
EXERCISE [Pages 131 - 135]

Dheeraj Mehrotra solutions for Computer Science [English] Class 12 6 Variables and Expressions EXERCISE [Pages 131 - 135]

1. (i)Page 131

Define the term Variables.

1. (ii)Page 131

Define the term Constants.

2.Page 131

What are Data Types?

3.Page 131

Write about the various Data Types of Java.

4.Page 131

Explain the int Data Type with an Example.

5.Page 131

Explain the Floating Point data tyре.

6.Page 131

Explain the char Data Type with an Example.

7. (i)Page 131

Explain the features of variables.

7. (ii)Page 131

Explain the features of Constants.

8.Page 131

What are the rules for naming a variable in JAVA?

9.Page 131

Explain the various types of Variables in JAVA.

10.Page 131

Write about the declaration of Variables in JAVA.

11.Page 131

Define the term Initialization of Variables.

12.Page 131

How is an assignment statement used in JAVA.

13.Page 131

Explain the features of Constants.

14. (i)Page 131

What are Operators?

14. (ii)Page 131

Explain the Various Types of Operators in Java.

15.Page 131

Explain the various shorthand notations in JAVA.

16.Page 131

Explain the Relation Operator with the help of an example program.

17. (i)Page 131

What is an Increment Operator in Java? Explain with an example.

17. (ii)Page 131

What is a Decrement Operator in Java? Explain with an example.

18. (i)Page 131

What are Bitwise Operators?

18. (ii)Page 131

Explain the Various Types of Bitwise Operators in Java.

19. (i)Page 131

What are ternary operators?

19. (ii)Page 131

Explain the Syntax of the Ternary Operator with an Example Program.

20.Page 131

Explain the various Expressions of Java.

21.Page 131

What do you understand by Type Conversion?

22. (i)Page 131

Explain the term Automatic Conversion.

22. (ii)Page 131

Explain the Utility of Automatic Conversion.

23.Page 131

What is meant by Type Casting? Explain with the help of an example program.

24.Page 131

What is meant by the precedence of operators?

25. (i)Page 131

Explain the Interpretation of Java Programs.

25. (ii)Page 131

Explain the Compilation of Java Programs.

25. (iii)Page 131

Explain the Linking of Java Programs.

25. (iv)Page 131

Explain the Execution of Java Programs.

26.Page 131

Explain Debugging of a Java Program.

27.Page 131

What are Compiler Errors?

28.Page 131

Explain the term Interpreter Errors.

29. (i)Page 131

Explain the following with an example segment:

Bitwise Characters

29. (ii)Page 131

Explain the following with an example segment:

Escape Character

29. (iii)Page 131

Explain the following with an example segment:

Modulus Operator

29. (iv)Page 131

Explain the following with an example segment:

Unary Operator

29. (v)Page 131

Explain the Syntax of the Ternary Operator with an Example Program.

30. (a)Page 132

Differentiate between the following:

Constant and Variable

30. (b)Page 132

Differentiate between the following:

float and double

30. (c)Page 132

Differentiate between the following:

int and long

30. (d)Page 132

Differentiate between the following:

Post increment and Pre increment operator

30. (e)Page 132

Differentiate between the following:

Increment and Decrement operators

31. (a)Page 132

Explain the following operator with an example program:

Arithmetic Operator
 
31. (b)Page 132

Explain the following operator with an example program:

Relational Operator

31. (c)Page 132

Explain the following operator with an example program:

Logical Operator

31. (d)Page 132

Explain the following operator with an example program:

Increment & Decrement Operator

31. (e)Page 132

Explain the following operator with an example program:

Conditional Operator

31. (f)Page 132

Explain the following operator with an example program:

Unary Operator

32.Page 132

Define the precedence of operators in Java.

33.Page 132

What is the value of x after evaluating:

x + = x + + + - - x + 4; if x = 3, 

before the evaluation?

34. (a)Page 132

Explain the following:

An Expression of Java

34. (b)Page 132

Explain the following:

Type Conversion and its forms

34. (c)Page 132

Explain the following:

Java Shorthands

34. (d)Page 132

Explain the term type casting.

34. (e)Page 132

Explain the following:

Type Promotion

35.Page 132

Name the value of ((1/0.0) - (1/-0.0))?

36. (a)Page 132

Evaluate the following Java expression, where a, b and c are integers and d and f are floating-point numbers. The values are a = 5, b = 3 and d = 1.5.

f  =  a + b/a

36. (b)Page 132

Evaluate the following Java expression, where a, b and c are integers and d and f are floating-point numbers. The values are a = 5, b = 3 and d = 1.5.

c = d*a + b

36. (c)Page 132

Evaluate the following Java expression, where a, b and c are integers and d and f are floating-point numbers. The values are a = 5, b = 3 and d = 1.5.

c = (a++)*d + a

36. (d)Page 132

Evaluate the following Java expression, where a, b and c are integers and d and f are floating-point numbers. The values are a = 5, b = 3 and d = 1.5.

f = (++b)* b - a

36. (e)Page 132

Evaluate the following Java expression, where a, b and c are integers and d and f are floating-point numbers. The values are a = 5, b = 3 and d = 1.5.

c = a – (b++)*(–d)

37.Page 132

Illustrate '?' operator.

38.Page 132

Differentiate between the following:

Post increment and Pre increment operator

39.Page 132

What is the meaning of variable++?

40.Page 132

What does the following program output to the monitor:

int value = 0;
int count = 1;
value = count++;
System.out.println("value:" + value "+ count:" + count);
41.Page 132

What does the following program output to the monitor:

int value = 0;
int count = 1;
value = ++count; /* note change from previous */
System.out.println("value:" + value "+ count:" + count );
42.Page 132

What is the output of the following:

int a = 0;
int b = 10;
a =-b;
System.out.println("a:” + a + “b:" +b);
43.Page 132

What is the output of the following program:

double w = 12.5;
w*= 2;
System.out.println("w is" + w);
44.Page 133

Which of the answers does the same thing as the following:

value += sum++;

  • value = value + sum;
    sum = sum + 1;

  • sum = sum + 1;
    value = value + sum;

  • value = value + sum;

  • value = value + ++sum;

45.Page 133

Fill in the blank so that wages are divided by two.

wages ______ 2;

46.Page 133

Are the auto-increment and auto-decrement operators (++ and –) an essential part of the Java language?

47.Page 133

Which one of the following is NOT a correct arithmetic expression?

  • alpha

  • (alpha / momentum) - 12.4

  • alpha (/ momentum - 12.4)

  • ((alpha / momentum) - 12.4)

48.Page 133

What is an operand?

49.Page 133

Assume the following declarations:

short a=12;
int b=33;
float x=2.3;
double y=3.14;

Which one of the following expressions will NOT be evaluated using double precision floating point?

  • a + x

  • 1.5 + 8.6

  • a + b

  • x/y

50.Page 133

What does the following class output?

class output
{
public void work()
{
int totalCost = 6;
int items = 12;
System.out.println("cost per item: "+ totalCost/items);
}}
  • cost per item: .5

  • cost per item: 0

  • cost per item: 1

  • cost per item: +6/12

51.Page 133

What is the result of evaluating the following expression?

(1/2 + 3.5) * 2.0

52.Page 132

What is the result of evaluating the following expression?

–32/6

53.Page 133

What is an expression?

54.Page 133

What is the value of −32% 6?

55.Page 134

What gets displayed on the screen when the following program is compiled and run. Select the one correct answer.

public class test{
public static void main(String args[]){
int x;
x = -3 >> 1;
x = x >>> 2;
x = x<<1;
System.out.println(x);
}
}
57.Page 134

What gets displayed on the screen when the following program is compiled and run. Select the one correct answer.

public class test {
public static void main(String args[]) {
int x, y;
x = 5 >> 2;
y = x>>> 2;
System.out.println(y);
}
}
58.Page 134

What gets displayed on the screen when the following program is compiled and run. Select the one correct answer.

public class test 
{
public static void main(String args[]) 
   {
   boolean x = true;
   int a;
   if(x) a = x ? 1: 2;
   else a = x? 3: 4;
   System.out.println(a);
   }
}
59. (a)Page 135

If a = 12, give the value of the following expression:

a++

59. (b)Page 135

If a = 12, give the value of the following expression:

++a

59. (c)Page 135

If a = 12, give the value of the following expression:

(a++)--;

a. (d)Page 135

If a = 12, give the value of the following expression:

a + = 2;

59. (e)Page 135

If a = 12, give the value of the following expression:

a − = 10;

59. (f)Page 135

If a = 12, give the value of the following expression:

--a + (++a)

59. (g)Page 135

If a = 12, give the value of the following expression:

(a++) + (--а)

60. (a)Page 135

Explain the usage of the following special symbol in Java:

,(comma)

60. (b)Page 135

Explain the usage of the following special symbol in Java:

;(semicolon)

60. (c)Page 135

Explain the usage of the following special symbol in Java:

{}(braces)

60. (d)Page 135

Explain the usage of the following special symbol in Java:

()(simple brackets)

60. (e)Page 135

Explain the usage of the following special symbol in Java:

[](brackets)

Solutions for 6: Variables and Expressions

EXERCISE
Dheeraj Mehrotra solutions for Computer Science [English] Class 12 chapter 6 - Variables and Expressions - Shaalaa.com

Dheeraj Mehrotra solutions for Computer Science [English] Class 12 chapter 6 - Variables and Expressions

Shaalaa.com has the CISCE Mathematics Computer Science [English] Class 12 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. Dheeraj Mehrotra solutions for Mathematics Computer Science [English] Class 12 CISCE 6 (Variables and Expressions) 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. Dheeraj Mehrotra textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.

Concepts covered in Computer Science [English] Class 12 chapter 6 Variables and Expressions are Variables as Names for Values, Expressions (Arithmetic and Logical) and Their Evaluation (Operators, Associativity, Precedence), Assignment Operation, Difference Between Left Hand Side and Right Hand Side of Assignment.

Using Dheeraj Mehrotra Computer Science [English] Class 12 solutions Variables and Expressions 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 Dheeraj Mehrotra Solutions are essential questions that can be asked in the final exam. Maximum CISCE Computer Science [English] Class 12 students prefer Dheeraj Mehrotra Textbook Solutions to score more in exams.

Get the free view of Chapter 6, Variables and Expressions Computer Science [English] Class 12 additional questions for Mathematics Computer Science [English] Class 12 CISCE, and you can use Shaalaa.com to keep it handy for your exam preparation.

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×