+1 and +2 Computer Science

Previous Question paper answered , and Questions from Textbook

+1 and +2 Computer Application

Previous Question paper answered , and Questions from Textbook

Diploma in Computer Application (DCA)

Previous Question paper answered , and Questions from Textbook.

Master of Computer Applications (MCA)

Previous Question paper answered , and Questions from Textbook

True IQ Computer Online Academy

Contact : +91 9036433020 , mail2trueiq@gmail.com

Pageviews

Friday, 6 September 2019

+1]5 . Data Types And Operators - Previous Questions from chapter wise



               PLUS ONE 
COMPUTER APPLICATION / COMPUTER SCIENCE

            First Year Computer Application(Commerce) Previous Questions Chapter wise ..


                                         Chapter  5 (6 for CS) Data Types And Operators




1. Given that x= 5  y=5. What will be the value of the expression x > y|| y > x? 

     Ans. False

2.  While writing a C++ program, a student forget to put semicolon at the end of a   declaration                  statement.What type of error can he expect during compilation ? 

     Ans. Syntax Error

3.   The memory size of float data type in C++ is ...............  bytes.


    a)2

     b)4 

     c)8 

      d)10 

   Ans. b

4.  Explain different types of  logical operators on C++

   and (&&):( Result will be true  only if both the combined expressions have true value)      

  or(||):Result will be true  only if any of  the combined expressions have true value )     

 not(!): To get the negation of the give expression

 d). input/out put operators: input(get from or extract operator), output (put to or  insertion operator) 

e). Assignment operator: = (to assign a value to a variable). 

5.  What is the difference between “=” and “= =” operators?

           When we have to store a value in a memory location, assignment operator (=) is used. This is a binary operator and hence two operands are required. The first operand should be a variable where the value of the second operand is to be stored.

         The = symbol assigns a value to a variable, whereas == symbol compares two values and gives True or False as the result.

6.   What is the difference between  x= 5  and x ==5 in C++

          x=5 means the value 5 is assigned or stored the variable X but X==5 means both values are compares and it gives true or false as the result. 

7. Identify the name of following operators in C++. 
      && , || , !

  Ans. && : Logical And

           ||  : Logical Or

            ! : Logical Not

8.  .Write the declaration in C++ for a variable that can be used to store height of  a   student.                    Justify, why you  have selected this data type in the declaration. 

  Ans. float Height ;

9.  Which of the following is not a character constant in C++? 
      a) ‘a’

      b) a

      c) ‘8’

       d)’\a’  

    Ans. b

10. . Memory requirement of void data type in C++ is .......... byte(s

     Ans. 0 byte

11. .Let X and Y are two variables of int data type, then correct the following  input                               statement.  

  cin<< X >> Y;

   Ans. cin>>X>>Y;

12. Write the output of the following C++ expressions. Let a=7,b=2.

     a) a+b *3/ ++b;    

     b) a<=7&&b>1;

   Ans. a) 7+2*3/++2 = 7+2*3/3 =7+2*1 =7+2=9

            b) 7<=7&&2>1 ----->True statement 

13.  Write value returned by the C++ expressions

      a). 60 % 25;

      b).  22 / 7; 


     Ans. a. 10

              b. 3


14.  How do the type modifiers affect the size and range of int and char data types?

          By using different number of bytes to store values, C++ offers three types of integers : short, int, and long that can represent up to three different integer sizes. Each comes in both signed and unsigned versions.In integer 4 bytes are used,ranges from 2147483648 to +2147483647.

     

The char type can also be signed or unsigned. Unlike int, char is neither signed nor unsigned by default. The choice is left to the C++ implementation in order to allow the implementer to best fit the type to the hardware properties.

However, these distinctions are particularly important if you are using char as a numeric type. The unsigned char represents the range 0 to 256 and signed char represents the range -128 to 127.In char 1 byte is used.

15 . Explain the difference between float g=9.8 ; and const float g=9.8?

             ref 6th chapter QS 12

16. What is implicit type conversion?Why it is called type promotion ?

             Implicit Type Conversion also known as 'automatic type conversion'. Done by the compiler on its own, without any external trigger from the user. Generally takes place when in an expression more than one data type is present. In such condition type conversion (type promotion) takes place to avoid lose of data.

17.  Distinguish between float and double data types in C++.

            Float : They are numbers with fractional part. It uses four bytes of memory. It  can be                                      represented either by scientific notation or mantissa exponential  method. 

          Double: It is used for handling large floating point numbers. It uses 8 bytes of memory.

18. . What is a variable ?Differentiate between memory address and content of the variable.

           Name given to a memory location is known as variable. It is use to store and retrieve data. It have three part: a) variable name  b). Memory address(starting address of the allocated memory)       c). Content .

       The RAM of a computer consists of collection of cells each of which can store one byte of data. Every cell (or byte) in RAM will be assigned a unique address to refer it. All the variables are connected to one or more memory locations in RAM. The base address of a variable is the starting address of the allocated memory space.

    The value stored in the location is called content of the variable. This is also called the R-value of the variable. Type and size of the content depends on the data type of the variable. Here the variable name is Num and it consumes 4 bytes of memory at memory addresses 1001, 1002, 1003 and 1004. The content of this variable is 18. That is L-value of Num is 1001 and R-value is 18.


           Image result for memory allocation of a variable images    
19.  Briefly explain any two expressions in C++. 

         expressions are composed of operators and operands. It is evaluated to get a         value(returning of value) On the basis of operators expressions can be divided into,

 a). Arithmetic expression: Expression in which arithmetic operators are used ( may be integer  or             floating point expression)

 b). Relational expression : Expression in which relational operators are used 

20.  Predict the output of the following operations. x = -5 and y = 3 initially.           

a). –x 

b). x/y  

c). x % y 

d). –x + -y 

Ans.a.  -(-5) = 5

         b.  -5/3 =-1

           c. -5%3 = -2

            d. -(-5)+-3 =2

21. . Consider the following statement.  int length;          
Then what is the difference between (a) and (b)?  a). length = 50; b). length = = 50; 

         refer Qs no.s 5 and 6

22.  Write sample statements in C++ for the cascading of input and output operators

            Multiple use of Input / Output operators in a single statement is called cascading of I/O Operator. Here the values are assigned to the variables from left to right.

 Eg. cout << x <<y <<z;

         cin >> x >> y;

23.  Explain the operations involved in the following C++ expressions and write the output.

 a) 5/2+3

 b) (10%3)/2.0

   Ans. a. 5

           b. 0.5

24. Write four different C++ statements to add 1 to the value stored in the variable     
   Num.

25.  What is the output of the following C++ statements.
   X= -7    Y = 3
   a) add –x with –y
   b) x  modulus  y

  Ans. a. -(-7)+3 =10

          b. -7%3 = -1

26. . What are data types ?Explain the fundamental data types in C++.

            Data types are the means to identify the nature of the data and the set of operations that can be performed on the data.

    There are three types of data types C++,

a). Fundamental data type (built in Data types):

 They are defined in the C++ compiler. They can not be further broken down. There are 5 types of Fundamental data types,

1). Char: They are symbols covered by the character set of C++ language. It uses only one byte                       of memory (storing in memory with its ASCII value). 

2). Int  : Whole numbers without fractional part. It can be positive or negative, or zero. It uses                       Four bytes of memory based on GCC compiler.

 3). Float : They are numbers with fractional part. It uses four bytes of memory. It  can be                            represented either by scientific notation or mantissa exponential  method.

 4). Double: It is used for handling large floating point numbers. It uses 8 bytes of memory.

 5). Void : uses zero bytes of memory.

27.  Classify the identifiers given below as valid and invalid .Give reason for invalidity.

sum

if

_Num 1

Switch

stud Age

   Ans. Valid: sum,_Num1

          Invalid : if ,Switch,stud Age

       if and Switch are keywords. stud Age is invalid identifier because white space is prohibited.

28.If a=5, b=7 and c=3.  Predict the output of the following expresssions.

a) a<c

b) b%a

 c) (a<c) && (a<b)

 d) a/c

  Ans. a. False

            b. 7%5 = 2

             c. False

              d. 5/3 =1

29.  Predict the value of 'b' in the following C++ code after execution of each code snippet

   a) and  b) Justify your answer.

 a) a = 5; b = a++;

 b) a = 5; b = ++a;

Ans. a. b=5

          b. b=6

30.   List the three numeric data types in C++ with an example for each

31.  If a = 5,   b = 4,   c = 3,  d = 4 then what is the result in x after following operation?

       X=a + b – c * d;

        Ans. X =5+4-3*4 = 5+4-12 = -3

32.  Is there any difference between (a) and (b) by considering the following statement?   char             Gender;        a). Gender  = ‘M’;        b). Gender = “M”;

          In Gender='M' means  Characters are the symbols covered by the character set of the C++ language. All letters, digits, special symbols, punctuations, etc. come under this category. When these characters are used as data they are considered as char type data in C++. We can say that the keyword char represents character literals of C++. Each char type data is allowed one byte of memory.

        Gender="M" is wrong statement because single character representation using single quote.

33.  Write a short note on arithmetic And logical operators in C++.

          Arithmetic operators are defined to perform basic arithmetic operations such as addition, subtraction, multiplication and division. The symbols used for this are +, -, * and / respectively. C++ also provides a special operator % (modulus operator) for getting remainder during division. All these operators are binary operators. Note that + and - are used as unary operators too. The operands required for these operations are numeric data. The result of these operations will also be numeric.

         Using relational operators, we can compare values. Examples are 3<5, num!=10, etc. These comparison operations are called relational expressions in C++. In some cases, two or more comparisons may need to be combined. In Mathematics we may use expressions like a>b>c. But in C++, it is not possible. We have to separate this into two, as a>b and b>c and these are to be combined using the logical operator &&, i.e. (a>b)&&(b>c). The result of such logical combinations will also be either True or False (i.e. 1 or 0). The logical operators are && (logical AND), || (logical OR) and ! (logical NOT).

34.  Write the equivalent arithmetic operations for the given C++ short hands.

 i) x% =20;    il) a+=2;   Iii)p / = 5;

 b) What is the difference between a = 20 and a = = 20?

     Ans. X=X%20
    
            b. a=a+2

             c. p=p/5


          a=20 means  the constant 20 is assigned to the variable a. a==20 means compares two values and it gives may true or false as the result.

35.  Classify the following identifiers valid or invalid. If invalid give reason.

 a). Length_1

 b). _Length1

c). Length 1

d). 1Length 

Ans. Valid: Length_1 ,_Length1

          Invalid : Length 1 ,1Length. Because identifiers are not using digit in first and Between words white spaces are not  alloweded.
       

Sunday, 1 September 2019

+1]5. Data Types And Operators - solved Questions from text book

PLUS ONE 
COMPUTER APPLICATION / COMPUTER SCIENCE                    
Chapter 5 (6 for CS) Data Types And Operators

(+1. Computer Application Questions and answers from text book)



1. Predict the output of the following operations if x=5 and y=3.

a. x>=10 && y>=4                       

 b. x>=1 && y>=3

c. x>5 && y>=2

 d. x<10 && y>2

e. x<10 && y>x

f. x>=10 || y>=4

g. x>=1 || y>=3

h. x>5 || y>=2

 i. x<10 || y>2

 j. x<10 || y>x

Ans.   a. FALSE                   

          b. TRUE

         c. FALSE

         d. TRUE

         e. FALSE

          f.  FALSE

           g. TRUE

           h.  TRUE

            i. TRUE

            j. TRUE

 2. Predict the output if p=5, q=3, r=2

 a. p-q*r/2                       

b. p*q/r                               

c. p-q-r*2+p

d. p+5*q+r*r/2

  Ans. a. 5-3*2/2 = 5-3*1 =2

            b. 5*3/2 =7.5
 
            c. 5-3-2*2+5 =5-3-4+5 =10-7=3

            d. 5+5*3+2*2/2 = 5+15+2 =22

3. What are data types? List all predefined data types in C++?

          Image result for different types of expressions in c++ images

            Data types are the means to identify the nature of the data and the set of operations that can be performed on the data.

            There are 5 types of Fundamental data types,
1). Char: They are symbols covered by the character set of C++ language. It uses only one byte                       of memory (storing in memory with its ASCII value).
 2). Int  : Whole numbers without fractional part. It can be positive or negative, or zero. It uses                       Four bytes of memory based on GCC compiler.
 3). Float : They are numbers with fractional part. It uses four bytes of memory. It  can be                            represented either by scientific notation or mantissa exponential  method.
  4). Double: It is used for handling large floating point numbers. It uses 8 bytes of memory. 
5). Void : uses zero bytes of memory.

4. What is the use of void data type?

        The data type void is a keyword and it indicates an empty set of data. Obviously it does not                   require any memory space.
5. What is a constant?

       Constants are like a variable, except that their value never changes during execution once defined. ...Constants in C are the fixed values that are used in a program, and its value remains the same during the entire execution of the program. Constants are also called literals. Constants can be any of the data types.

6. What is dynamic initialization of variables?

        Dynamic initialization is that in which initialization value isn't known at compile-time. It's computed at runtime to initialize the variable. Example, ... That is, static-initialization usually involves constant-expression (which is known at compile-time), while dynamic-initialization involves non-constant expression.

7. Define operators.

        Tokens constituted by predefined symbols that can trigger to carry out operation. The participants of the operation are called operands. The operators either be constant or literal

6. What is meant by a unary operation?

         only one operand( eg +(positive),-(negative)

example:+x,-y etc.

7. What is declaration statement?

           It is used to declare the type of the variable or constant used in  the program. 

           Eg. int   x, y ; int a=10;
8. What is the input operator ">>" and output operator "<<" called ?

           extract operator(>>) and  insertion operator(<<)

9. What will be the result of a = 5/3 if a is
(i) float

 (ii) int

    Ans. i. 1.66

             ii. 1
 
10. Write an expression that uses a relational operator to return true if the variable
total is greater than or equal to final.

11. Given that i =4, j =5, k =2 what will be the result of following expressions?

(i) j <k          ------------                 False

(ii) j <j         -----------                     False

 (iii) j <= k    -----------                    False

(iv) i == j         ------------                 False

(v) i == k          -----------                  False

(vi) j > k            ----------                   True

(vii) j >= i          ----------                 True

(viii) j! = i          ------------              True

 (ix) j! = k          ---------------           True

(x) j <= k           ---------------            True


12. What will be the order of evaluation for following expressions?

(i) i+5>=j-6

 (ii) s+10<p-2+2*q

   Ans. i.

13. What will be the result of the following if ans is 6 initially?

(i) cout <<ans = 8 ;

(ii) cout << ans == 8


Ans. i.

14. What is a variable? List the two values associated with a variable.

        Name given to a memory location is known as variable. It is use to store and retrieve data. It have three part: a) variable name  b). Memory address(starting address of the allocated memory)       c). Content 4

 15. Explain logical operators.

      and (&&):  ( Result will be true  only if both the combined expressions have true value).

     or(||):  Result will be true  only if any of  the combined expressions have true value ).   

      not(!): To get the negation of the give expression.

16. Find out the errors, if any, in the following C++ statements

 (i) cout<< "a=" a;

(ii) m=5, n=l2;015

(iii) cout << "x" ; <> y 

(viii) break = x 

(v) cin >> "\n" >> y ;

(vi) cout >> \n "abc"

17. What is the role of relational operators? Distinguish between == and =.

       Relational operators are used for comparing numeric data. These are binary operators. The result of any relational operation will be either True or False. In C++, True is represented by 1 and False is represented by 0. There are six relational operators in C++. They are < (less than), > (greater than), == (equal to), <= (less than or equal to), >= (greater than or equal to) and != (not equal to). Note that equality checking requires two equal symbols (==).

       Both are not same, = is an Assignment Operator it is used to assign the value of variable or expression, while == is an Equal to Operator and it is a relation operator used for comparison (to compare value of both left and right side operands).

 18.  Explain the operators used in C++ in detail.

                        Image result for operators in c++ images

           Operators are tokens constituted by predefined symbols that can trigger computer to carry out operations. The participants of an operation are called operands. An operand may be either a constant or a variable.For example, a+b triggers an arithmetic operation in which + (addition) is the operator and a, b are operands. Operators in C++ are classified based on various criteria. Based on number of operands required for the operation, operators are classified into three. They are unary, binary and ternary.

        Unary operators : A unary operator operates on a single operand. Commonly used unary operators are unary+ (positive) and unary- (negative). These are used to represent the signs of a number. If we apply unary+ operator on a signed number, the existing sign will not change. If we apply unary- operator on a signed number, the sign of the existing number will be negated.

        Binary operators: Binary operators operate on two operands. Arithmetic operators, relational              operators, logical operators, etc. are the commonly used binary operators.

        Ternary operator :Ternary operator operates on three operands. The typical example is the conditional operator (?:).

       Arithmetic operators

 Arithmetic operators are defined to perform basic arithmetic operations such as addition, subtraction, multiplication and division. The symbols used for this are +, -, * and / respectively. C++ also provides a special operator % (modulus operator) for getting remainder during division. All these operators are binary operators. Note that + and - are used as unary operators too. The operands required for these operations are numeric data. The result of these operations will also be numeric.

       Modulus operator (%)

 The modulus operator, also called as mod operator, gives the remainder value during arithmetic division. This operator can only be applied over integer operands.

          Relational operators

Relational operators are used for comparing numeric data. These are binary operators. The result of any relational operation will be either True or False. In C++, True is represented by 1 and False is represented by 0. There are six relational operators in C++. They are < (less than), > (greater than), == (equal to), <= (less than or equal to), >= (greater than or equal to) and != (not equal to). Note that equality checking requires two equal symbols (==).

          Logical operators

Using relational operators, we can compare values. Examples are 3<5, num!=10, etc. These comparison operations are called relational expressions in C++. In some cases, two or more comparisons may need to be combined. In Mathematics we may use expressions like a>b>c. But in C++, it is not possible. We have to separate this into two, as a>b and b>c and these are to be combined using the logical operator &&, i.e. (a>b)&&(b>c). The result of such logical combinations will also be either True or False (i.e. 1 or 0). The logical operators are && (logical AND), || (logical OR) and ! (logical NOT).

            Input / Output operators

 Usually input operation requires user's intervention. In the process of input operation, the data given through the keyboard is stored in a memory location. C++ provides >> operator for this operation. This operator is known as get from or extraction operator. This symbol is constituted by two greater than symbols. Similarly in output operation, data is transferred from RAM to an output device. Usually the monitor is the standard output device to get the results directly. The operator << is used for output operation and is called put to or insertion operator. It is constituted by two less than symbols.

             Assignment operator (=)

When we have to store a value in a memory location, assignment operator (=) is used. This is a binary operator and hence two operands are required. The first operand should be a variable where the value of the second operand is to be stored.

 19. Explain different types of expressions in C++.

             An expression is composed of operators and operands. The operands may be either constants or variables. All expressions can be evaluated to get a result. This result is known as the value returned by the expression. On the basis of the operators used, expressions are mainly classified into arithmetic expressions, relational expressions and logical expressions.

            Arithmetic expressions

 An expression in which only arithmetic operators are used is called arithmetic expression. The operands are numeric data and they may be variables or constants. The value returned by these expressions is also numeric. Arithmetic expressions are further classified into integer expressions, floating point (real) expressions and constant expressions.

           Integer expressions

 If an arithmetic expression contains only integer operands, it is called integer expression and it produces integer result after performing all the operations given in the expression.

          Floating point expressions (Real expressions)

An arithmetic expression that is composed of only floating point data is called floating point or real expression and it returns a floating point result after performing all the operations given in the expression.

            Relational expressions

 When relational operators are used in an expression, it is called relational expression and it produces Boolean type results like True (1) or False (0). In these expressions, the operands are numeric data.

         Logical expressions

 Logical expressions combine two or more relational expressions with logical operators and produce either True or False as the result. A logical expression may contain constants, variables, logical operators and relational operators.


20. Arrange the fundamental data types in ascending order of size.

           Int,Float,Double,Char.

21. The name given to a storage location is known as ___________.

    Ans. Memory Address

 22. Name a ternary operator in C++.

   Ans. Conditional Operator 

23. Predict the output of the following operations if x = -5 and y = 3 initially

 a. -x

b. -y

 c. -x + -y

 d. -x - y

 e. x % -11

f. x+y

g. x%y

 h. x/y

i. x * -y

j. -x %-5

Ans.      a. 5

             b. -3

           c. -(-5)+-3 = 2

            d. -(-5)-2 =2

             e. -5%-11 = -5

               f. -5+3 = -2

                g. -5%3 = -2

                h. -5/3 = -1

                 i.   -5*-3 =15

                  j. -(-5)%-5 =0

Thursday, 29 August 2019

+1] 4. Getting Started With C++/Introduction to C++ Programming - Previous Questions chapter wise



               PLUS ONE COMPUTER APPLICATION/COMPUTER SCIENCE

            First Year Computer Application(Commerce) Previous Questions Chapter wise ..


                                         Chapter  4. Getting Started With  C++(For CA)

                                          Chapter 5 Introduction to C++ programming (for CS)



1.  Which header file is responsible for cout and cin objects ? 

    <iostream>

2.  C++ uses the ..........  language processor for translation. 

      Ans. IDE

3.  .. …..  ..are tokens that never change their values while execution takes place.

     Ans. Constants/ Literals

4.  IDE stands for  … …. …. … … 

    Ans. Integrated Development Environment

5.  Identify and classify the different tokens in the following C++ statement.  Age = 18;

Ans:  age : identifier      =:  operator    18 : Literal    ; : Punctuator 

6. Explain the rules for naming identifiers
  • Identifier is an arbitrary long sequence of letters, digits and underscores( _ )
  • The first character must be a letter or underscore ( _ ).
  • White space and special characters are not allowed. 
  •  Keywords cannot be used as identifiers. 
  •  Upper and lower case letters are treated differently, i.e. C++ is case sensitive


7. The following are invalid identifiers in C++. Write a reason for each


  a) Id#

 b) void

c) 2ab

 d) avg hgt

8.  Define tokens in C++. List ant four types of tokens

         The term ‘token’ in the C++ language is similar to the term ‘word’ in natural languages. Tokens are the fundamental building blocks of the program. They are also known as lexical units. C++ has five types of tokens as listed below:

 1. Keywords 2. Identifiers 3. Literals 4. Punctuators 5. Operators

9. a). What is a token in C++ ?     

   b). Distinguish between keywords and identifiers

Ans. The term ‘token’ in the C++ language is similar to the term ‘word’ in natural languages. Tokens are the fundamental building blocks of the program.

b.  Identifiers are the user-defined words that are used to name different program elements such as memory locations, statements, functions, objects, classes etc. The identifiers of memory locations are called variables. The identifiers assigned to statements are called labels. The identifiers used to refer a set of statements are called function names.

      The words (tokens) that convey a specific meaning to the language compiler are called keywords. These are also known as reserved words as they are reserved by the language for special purposes and cannot be redefined for any other purposes. The set of 48 keywords


Wednesday, 28 August 2019

+1] 4. Getting Started with C++ / Introduction in C++Programming - Solved Questions from text book.


                     PLUS ONE 
COMPUTER APPLICATION / COMPUTER SCIENCE 


                                     Chapter 4 Getting Started with C++ (for CA)

                                    Chapter 5.   Introduction in C++Programming (for CS)

                  (+1. Computer Application  Questions and answers from text book)

1. What are the different types of characters in C++ character set?

   (i)  Letters : A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o                               p q  r s t u v w x y z

(ii) Digits : 0 1 2 3 4 5 6 7 8 9

(iii) Special characters : + - * / ^ \ ( ) [ ] { } = < > . ’ “ $ , ; : % ! & ? _ (underscore) # @

(iv) White spaces : Space bar (Blank space), Horizontal Tab (à), Carriage Return (↵ ) , Newline,                   Form  feed

(v) Other characters : C++ can process any of the 256 ASCII characters as data or as literals

 2. What is meant by escape sequences?

          C++ language has certain non-graphic character constants, which cannot be typed directly from the keyboard. For example, there is no way to express the Carriage Return or Enter key, Tab key and Backspace key. These non-graphic symbols can be represented by using escape sequences, which consists of a backslash (\) followed by one or more characters.

 3. Who developed C++?

         Dr. Bjarne Stroustrup developed C++

 4. What is meant by tokens? Name the tokens available in C++.

          The term ‘token’ in the C++ language is similar to the term ‘word’ in natural languages. Tokens are the fundamental building blocks of the program. They are also known as lexical units. C++ has five types of tokens as listed below:

 1. Keywords

 2. Identifiers

3. Literals

4. Punctuators

 5. Operators

 5. What is a character constant in C++ ?

        When we refer a single character enclosed in single quotes that never changes its value during the program run, we call it a character literal or character constant. Note that x without single quote is an identifier whereas ‘x’ is a character constant. The value of a single character constant is the ASCII value of the character.

 6. How are non-graphic characters represented in C++? Give an example.

         C++ language has certain non-graphic character constants, which cannot be typed directly from the keyboard. For example, there is no way to express the Carriage Return or Enter key, Tab key and Backspace key. These non-graphic symbols can be represented by using escape sequences, which consists of a backslash (\) followed by one or more characters. It should be noted that even though escape sequences contain more than one character enclosed in single quotes, it uses only one corresponding ASCII code to represent it. That is why they are treated as character constants.

Example  \n - New line,\b - Back space

7. Why are the characters \ (slash), ' (single quote), " (double quote) and ? (question mark) typed using escape sequences?

           These characters can be typed from the keyboard but when used without escape sequence, they carry a special meaning and have a special purpose. However, if these are to be displayed or printed as it is, then escape sequences should be used. Examples of some valid character constants are: 's', 'S', '$', '\n', '+', '9'.

8. Which escape sequences represent newline character and null character?

      Ans. \n and \0

9. An escape sequence represents ______ characters.

10. Which of the following are valid character/string constants in C++?

 'c'

 'anu'

"anu"

 mine

'main's'

" "

 'char

 '\ \'

Ans. Character constant: 'c'  'anu'  '\ \'  'main's'

         String constant   :  "anu"


   11. What is a floating point constant? What are the different ways to represent a floating point constant?

          Floating point literals, also known as real constants are numbers having fractional parts. These can be written in one of the two forms called fractional form or exponential form. A real constant in fractional form consists of signed or unsigned digits including a decimal point between digits. The rules for writing a real constant in fractional form are given below:

• A real constant in fractional form must have at least one digit and a decimal point.

 • It may also have either + (plus) or – (minus) sign preceding it.

• A real constant with no sign is assumed to be positive.

   A real constant in exponential form consists of two parts: mantissa and exponent. For instance, 5.8 can be written as 0.58×101 = 0.58E1 where mantissa part is 0.58 (the part appearing before E) and exponential part is 1 (the part appearing after E).

 12. What are string-literals in C++? What is the difference between character constants and string literals?

        String constant is a set of characters enclosed inside double quotes. ... The basic difference between string and character is that character constant can only be represented as a single entity whereas string constant is an array of characters with a null character at the end of the string.

      Examples of  character constant 'a'  '\ \'  'b' 'C'

       Examples of string constant  "'anu" " "

13. What is the extension of C++ program file used for running?

        Ans  .cpp

14. Find out the invalid identifiers among the following. Give reason for their invalidity

a) Principal amount

b) Continue

 c) Area

d) Date-of-join

e) 9B

 Principal amount : Blank space are not allowed

Date-of-join : Identifier is an arbitrary long sequence of letters, digits and underscores( _ ).

9B :  First character must be a letter or under_score.

 15. A label in C++ is ________.

 a) Keyword b) Identifier c) Operator d) Function

   Ans. b

 16. The following tokens are taken from a C++ program. Fill up the given table by placing them at the proper places

 ( int, cin, %, do, =, "break", 25.7, digit)

 ans.   Keywords       Identifiers         Literals            Operators

            int                  digit                     "Break"                   %

            cin                                                25.7                       =

              do

17. Write down the rules governing identifiers.

      Identifier is an arbitrary long sequence of letters, digits and underscores( _ ).

      • The first character must be a letter or underscore ( _ ).

      • White space and special characters are not allowed.

     • Keywords cannot be used as identifiers.

       • Upper and lower case letters are treated differently,

  i.e. C++ is case sensitive. Examples for some valid identifiers are Count, Sumof2numbers, _
_1stRank, Main, Average_Height, FOR

 18. Distinguish between identifiers and keywords.

         We usually assign names to places, people, objects, etc. in our day to day life, to identify them from one another. In C++ we use identifiers for this purpose. Identifiers are the user-defined words that are used to name different program elements such as memory locations, statements, functions, objects, classes etc. The identifiers of memory locations are called variables. The identifiers assigned to statements are called labels. The identifiers used to refer a set of statements are called function names

      The words (tokens) that convey a specific meaning to the language compiler are called keywords. These are also known as reserved words as they are reserved by the language for special purposes and cannot be redefined for any other purposes.

19. How are integer constants represented in C++? Explain with examples.

          Consider the numbers 1776, 707, -273. They are integer constants that identify integer decimal values. The tokens constituted only by digits are called integer literals and they are whole numbers without fractional part. The following are the characteristics of integer literals:

• An integer constant must have at least one digit and must not contain any decimal point.

 • It may contain either + or – sign as the first character, which indicates whether the number is positive or negative.


  •  number with no sign is treated as positive. 


    • No other characters are allowed.

   Example 70,714,-314 etc

20. Briefly describe different types of tokens.

       Tokens are the fundamental building blocks of the program. They are also known as lexical units. C++ has five types of tokens as listed below:

1. Keywords 2. Identifiers 3. Literals 4. Punctuators 5. Operators

         Keywords

            The words (tokens) that convey a specific meaning to the language compiler are called keywords. These are also known as reserved words as they are reserved by the language for special purposes and cannot be redefined for any other purposes.

 Examples do,for,while,int,float,break etc

          Identifiers

                Identifiers are the user-defined words that are used to name different program elements such as memory locations, statements, functions, objects, classes etc. The identifiers of memory locations are called variables. The identifiers assigned to statements are called labels. The identifiers used to refer a set of statements are called function names. While constructing identifiers certain rules are to be strictly followed for their validity in the program.

The rules are as follows:

 • Identifier is an arbitrary long sequence of letters, digits and underscores( _ ).

 • The first character must be a letter or underscore ( _ ).

 • White space and special characters are not allowed.

 • Keywords cannot be used as identifiers.

• Upper and lower case letters are treated differently, i.e. C++ is case sensitive.

 Examples for some valid identifiers are Count, Sumof2numbers, _1stRank, Main, Average_Height, FOR

          Literals

             Literals can be divided into four types as follows:

1. Integer literals

2. Floating point literals

3. Character literals

4. String literals

     Integer literals: Consider the numbers 1776, 707, -273. They are integer constants that identify integer decimal values. The tokens constituted only by digits are called integer literals and they are whole numbers without fractional part

      Floating point literals, also known as real constants are numbers having fractional parts. These can be written in one of the two forms called fractional form or exponential form.

 Example 314.42,52.0 etc

        When we want to store the letter code for gender usually we use ’f’ or ‘F’ for Female and ‘m’ or ‘M’ for Male. Similarly, we may use the letter ‘y’ or ‘Y’ to indicate Yes and the letter ‘n’ or ‘N’ to indicate No. These are single characters. When we refer a single character enclosed in single quotes that never changes its value during the program run, we call it a character literal or character constant.

examples '\n' 'a' 'Z' etc

     String constant is a set of characters enclosed inside double quotes.

     Examples "anu"    " "  etc
             
               Punctuators

       In languages like English, Malayalam, etc. punctuation marks are used for grammatical perfection of sentences. Consider the statement: Who developed C++? Here ‘?’ is the punctuation mark that tells that the statement is a question. Similarly at the end of each sentence we put a full stop (.). In the same way C++ also has some special symbols that have syntactic or semantic meaning to the compiler. These are called punctuators. Examples are: # ; ‘ “ ( ) [ ] { }

               Operators

      When we have to add 5 and 3, we express it as 5 + 3. Here + is an operator that represents the addition operation. Similarly, C++ has a rich collection of operators. An operator is a symbol that tells the compiler about a specific operation. They are the tokens that trigger some kind of operation. The operator is applied on a set of data called operands. C++ provides different types of operators like arithmetic, relational, logical, assignment, conditional, etc.

 21. Explain different types of literals with examples.

             Literals can be divided into four types as follows:

1. Integer literals

2. Floating point literals

3. Character literals

4. String literals

     Integer literals: Consider the numbers 1776, 707, -273. They are integer constants that identify integer decimal values. The tokens constituted only by digits are called integer literals and they are whole numbers without fractional part

      Floating point literals, also known as real constants are numbers having fractional parts. These can be written in one of the two forms called fractional form or exponential form.

 Example 314.42,52.0 etc

        When we want to store the letter code for gender usually we use ’f’ or ‘F’ for Female and ‘m’ or ‘M’ for Male. Similarly, we may use the letter ‘y’ or ‘Y’ to indicate Yes and the letter ‘n’ or ‘N’ to indicate No. These are single characters. When we refer a single character enclosed in single quotes that never changes its value during the program run, we call it a character literal or character constant.

examples '\n' 'a' 'Z' etc

     String constant is a set of characters enclosed inside double quotes.

        Examples "anu " "  "amount" "break"

 22. Briefly describe the Geany IDE and its important features.

          There are many compilers available like GCC, Borland C++, Turbo C++, Microsoft C++ (Visual C++), Unix AT & T C++, etc. Out of these, GCC is a free software available with Linux operating system. GCC stands for GNU Compiler Collection and is one of the popular C++ compilers which works with ISO C++ standard. GCC versions are available for Windows platforms also. Geany is a cross-platform IDE that works with GCC for writing, compiling and executing C++ programs.

Opening the edit window

 The edit window of Geany IDE can be opend from the Applications menu of Ubuntu Linux by proceeding as follows:

 Applications----> Programming-------> Geany

 To open a new file, choose File menu, then select New option or click New button on the toolbar.

    Saving the program

 Once a file is opened, enter the C++ program and save it with a suitable file name with extension .cpp. GCC being a collection of compilers, the extension decides which compiler is to be selected for the compilation of the code. Therefore we have to specify the extension without fail. If we give the file name before typing the program, GCC provides different colours automatically to distinguish the types of tokens used in the program. It also uses indentation to identify the level of statements in the source code.To save the program, choose File menu and select Save option or use the keyboard shortcut Ctrl+S. Alternatively the file can be saved by clicking the Save button in the toolbar.

Compiling and linking the program

The next step is to compile the program and modify it, if errors are detected. For this, choose Build menu and select Compile option.Alternatively, we can use the Compile button . If there are some errors, those errors will be displayed in the compiler status window at the bottom, otherwise the message Compilation finished successfully will be displayed.

Running/Executing the program

 Running the program is the process by which a computer carries out the instructions of a computer program. To run the program, choose Build menu and select Execute option. The program can also be executed by pressing the function key F5. The output will be displayed in a new window

Closing the IDE

 Once we have executed the program and desired output is obtained, it can be closed by selecting Close option from File menu or by clicking the X symbol in the active tab or in the title bar of the IDE. For writing another program, a new file can be opened by the New option from the File menu or by clicking the New button in the tool bar. The key combination Ctrl+N can also be used for the same. After developing program, we can come out of Geany IDE by choosing File menu and selecting Quit option. The same can be achieved by clicking the Close button of the IDE window or by using the key combination Ctrl+Q


+1]3. Principles Of Programming And Problem Solving - Previous Questions chapter wise


               PLUS ONE 
COMPUTER APPLICATION / COMPUTER SCIENCE 

            First Year Computer Application(Commerce) Previous Questions Chapter wise ..


                                         Chapter  3(4 for CS) Principles Of Programming And Problem Solving


1.  Fill the blank 

     Source Code ---- ……….. …. …… Object Code

  Ans. Translation

2. The process of converting source code into object code is called………

     Ans. Translation

3.  In a flowchart, the terminal symbol(ellipse) is used to indicate … .. and …..

      Ans. Start and Stop

4.  .  ..  … is the step by step procedure to solve problem.

      Ans. Algorithm

5.  Observe the following statements.

     a)Internal documentation consists of procedure for installing and using the program.

      b)Flowchart are pictorial representation of algorithms.

 Choose the most appropriate answer from the options given below.

i)Statement a) is correct

 ii)Statement b) is correct

 iii)Both statements are correct

iv)Both statements are incorrect.

Ans. i.

6.  Which of the following is not a part of program documentation?

   a). Writing comments in the source code.

   b). Detecting and correcting errors.

   c). preparation of system Manual. 

   d). Preparation of user manual.

Ans. b

7. While writing a C++ program, a student forgot to put semicolon at the end of the declaration                 statement .What type of error can he expect during compilation?

   Ans. Syntax Error.

8.  Write short notes on the following :

          a). Coding
       
          b). Debugging

           Ans.a. writing of actual program  in computer language.

                   b. Finding and correcting of errors in the program .

9. What are the characteristics of an algorithm?

     a). It will begin with instructions to accept inputs.
     b). Uses variables to refer data.
     c). Each instructions should be precise and clear.
     d). Instructions should be simple.
     e). The total time taken to carry out all steps should be finite.
     f). After performing the instructions, the desired output must be obtained

10.  Briefly explain different phases in programming.

         a). Problem Identification : To identify the data involved in processing, its types, formula to be                used, activities involve and the output to be obtained.

        b). Preparing of Algorithms and flowchart: to develop a step by step procedure for problem                       solving.

        c). Coding:   writing of actual program  in computer language.

        d) Translation:  Conversion of high level language program to machine language.

        e). Debugging :  Finding and correcting of errors in the program

        f). Execution and testing : Running of the program and testing for correctness.

       g). Documentation: It will help to understand the program  for proper usage and modification.

                   Two types of documentations.
     1) Internal documentation : Adding comments in program code etc..
     2) External Documentation: Writing manuals about the program for user help.

11. Write an algorithm to find the sum and average of 3 numbers.

     Step 1 : Start

    Step 2 :  Get the input of three real numbers and store in a,b,c

    Step 3: calculate sum <- a + b + c

    Step 4: calculate avg <- sum / 3

     Step 5: print sum and avg.

     Step 6 : Stop

12. Draw a flowchart to find the sum and average of even numbers between 1 and 99.

13.  Write a short note on the importance of internal documentation.

        A computerised system cannot be considered to be complete until it is properly documented. In fact documentation is an on-going process that starts in the problem study phase of the system and continues till its implementation and operation. We can write comments in the source code as part of documentation. It is known as internal documentation. It helps the debugging process as well as program modification at a later stage.

14.  Draw any six flow chart symbols and specify their standardized meanings.


   
   Image result for flowchart symbols

   
 15.  Explain the different types of errors that may occur in a program

           l there are two types of errors that occur in a program - syntax errors and logical errors. Syntax errors result when the rules or syntax of the programming language are not followed. Such program errors typically involve incorrect punctuation, incorrect word sequence, undefined term, or illegal use of terms or constructs. Almost all language processors detect syntax errors when the program is given for translation. They print error messages that include the line number of the statement having errors and give hints about the nature of the error.

         The second type of error, named logical error, is due to improper planning of the program's logic. The language processor successfully translates the source code into machine code if there are no syntax errors. During the execution of the program, computer actually follows the program instructions and gives the output as per the instructions. But the output may not be correct. This is known as logical error. When a logical error occurs, all you know is that the computer is not giving the correct output. The computers do not tell us what is wrong. It should be identified by the programmer or user. In order to determine whether or not there is a logical error, the program must be tested.

16.  Explain two types of documentation  in programming. 

            The second type of error, named logical error, is due to improper planning of the program's logic. The language processor successfully translates the source code into machine code if there are no syntax errors. During the execution of the program, computer actually follows the program instructions and gives the output as per the instructions. But the output may not be correct. This is known as logical error. When a logical error occurs, all you know is that the computer is not giving the correct output. The computers do not tell us what is wrong. It should be identified by the programmer or user. In order to determine whether or not there is a logical error, the program must be tested.

             Another version of documentation is the preparation of system manual and user manual. These are hard copy documents that contain functioning of the system, its requirements etc. and the procedure for installing and using the programs. While developing software for various applications, these manuals are mandatory. This kind of documentation is known as external documentation.

17.  Errors may occur in two stages of programming.        

  a) Name these two stages. Explain the nature of errors in these stages.   

    b) The process of correcting these errors is known as .......

   Ans. a) Debugging , Execution and Testing  are the stages  of programming.Syntax errors ,Logical errors and Run-time errors are the errors in these stages.

         Syntax errors result when the rules or syntax of the programming language are not followed. Such program errors typically involve incorrect punctuation, incorrect word sequence, undefined term, or illegal use of terms or constructs. Almost all language processors detect syntax errors when the program is given for translation.
   
       The second type of error, named logical error, is due to improper planning of the program's logic. The language processor successfully translates the source code into machine code if there are no syntax errors. During the execution of the program, computer actually follows the program instructions and gives the output as per the instructions. But the output may not be correct. This is known as logical error.

         For example consider an instruction A= B/C. This statement causes interruption in execution if the value of C happens to be zero. In such a situation, the error messages may be displayed by the error-handling function of the language. These errors are known as Run-time error. These errors can be rectified by providing instructions for checking the validity of the data before it gets processed by the subsequent instructions in the program.

    b)    Debugging. 

18. .An algorithm is a finite sequence of instruction to solve a problem.

a)What are the characteristics of algorithm ?      

b)Pictorial representation of algorithm is called .....................

Ans. a)  a). It will begin with instructions to accept inputs.
             b). Uses variables to refer data.
              c). Each instructions should be precise and clear.
              d). Instructions should be simple.
               e). The total time taken to carry out all steps should be finite.
               f). After performing the instructions, the desired output must be obtained.

         b)   Flowchart 

19. Write an algorithm And Flowchart to find and display fist 100 natural numbers.
                  
            Refer text book  page no.99       

+1]3.Principles Of Programming And Problem Solving - Solved Questions from text book


PLUS ONE 
COMPUTER APPLICATION / COMPUTER SCIENCE 

                   
  Chapter 3. (4 for CS)   Principles Of  Programming And Problem Solving

                  (+1. Computer Application  Questions and answers from text book)



1. What is an algorithm?

        In computer terminology an algorithm may be defined as a finite sequence of instructions to solve a problem. It is a step-by-step procedure to solve a problem, where each step represents a specific task to be carried out. However, in order to qualify as an algorithm.

2. Pictorial representation of algorithm is known as ______.

      Ans. Flowchart

3. Which flow chart symbol is always used in pair?

    Ans. connector

4. Which flow chart symbol has one entry flow and two exit flows?

   Ans. Decision  box.(Rhombus)

 5. Program written in HLL is known as ________.

    Ans.  Source code

 6. What is debugging?

         Debugging is the stage where programming errors are discovered and corrected. As long as computers are programmed by human beings, the programs will be subject to errors. Programming errors are known as 'bugs' and the process of detecting and correcting these errors is called debugging

 7. What is an object code?

       Now we have a program fully constituted by machine language instructions. This version of the source code is known as object code and it will be usually stored in a file by the compiler itself.

8. What is the role of a computer in problem solving?

      Computer can carry out tasks efficiently and accurately  if we give correct instructions. Computer is an obedient servant without any common sense.  So the computer can be used to solve problems by giving step by step instruction to solve it.

 9. What is the use of connector in a flow chart?

         When a flowchart becomes bigger, the flow lines start crisscrossing at many places causing confusion and reducing comprehension of the flowchart. Moreover, when the flowchart becomes too long to fit into a single page the use of flow lines becomes impossible. Whenever a flowchart becomes complex and the number and direction of flow lines is confusing or it spreads over more than one page, a pair of connector symbols can be used to join the flow lines that are broken. This symbol represents an "entry from", or an "exit to" another part of the flowchart.

 10. What do you mean by logical errors in a program?

      Two types of errors that occur in a program - syntax errors and logical errors

      Logical errors is due to improper planning of the program's logic. The language processor successfully translates the source code into machine code if there are no syntax errors. During the execution of the program, computer actually follows the program instructions and gives the output as per the instructions. But the output may not be correct. This is known as logical error. When a logical error occurs, all you know is that the computer is not giving the correct output. The computers do not tell us what is wrong. It should be identified by the programmer or user. In order to determine whether or not there is a logical error, the program must be tested. So, let us move on to the next stage of programming.

11. What are the limitations of a flow chart?

      a). Very time consuming to draw .
 
        b). Changing in logic is difficult.

       c). No standard about amount of details including .

12. What is the need of documentation for a program?

         A computerised system cannot be considered to be complete until it is properly documented. In fact documentation is an on-going process that starts in the problem study phase of the system and continues till its implementation and operation. We can write comments in the source code as part of documentation. It is known as internal documentation. It helps the debugging process as well as program modification at a later stage.Another version of documentation is the preparation of system manual and user manual. These are hard copy documents that contain functioning of the system, its requirements etc. and the procedure for installing and using the programs. While developing software for various applications, these manuals are mandatory. This kind of documentation is known as external documentation.

13. What is a computer program? How do algorithms help to write programs?

       A finite sequence of instructions to solve a problem written in a computer language.

Algorithm is a finite sequence of instructions to solve a problem. It is a step by step procedure to solve a problem. It may contain input, processing , conditions and  output statements. It follow the logical flow of the program. So writing of program is easy with the help of flowchart.

14. Write an algorithm to find the sum and average of 3 numbers.


    Step 1 : Start   

    Step 2 :  Get the input of three real numbers and store in a,b,c

    Step 3: calculate sum <- a + b + c

    Step 4: calculate avg <- sum / 3

     Step 5: print sum and avg.

     Step 6 : Stop

15. Draw a flowchart to display the first 10 natural numbers.


                     
      Same as first 100 natural numbers.Condition N<=100 instead of N<=10.       

16. What are the characteristics of an algorithm?

     a). It will begin with instructions to accept inputs.
     b). Uses variables to refer data.
    c). Each instructions should be precise and clear.
    d). Instructions should be simple.
    e). The total time taken to carry out all steps should be finite.
    f). After performing the instructions, the desired output must be obtained

17. What are the advantages of using a flowchart?

       a). Better communication: By using symbols, it is easy to convey ideas to other  programmers.

     b). Effective analysis:  Because it clearly specifies the flow of steps in the program.

    c). Effective synthesis:  Program can be divided into small modules and its solution  can represent separately and can finally placed together.
   d). Efficient Coding:   The flow chart act as a road map through which the programmer can develop program with out omission of important steps .

18. Briefly explain different phases in programming.

         a). Problem Identification : To identify the data involved in processing, its types, formula to be                used, activities involve and the output to be obtained.

        b). Preparing of Algorithms and flowchart: to develop a step by step procedure for problem                       solving.

        c). Coding:   writing of actual program  in computer language.

        d) Translation:  Conversion of high level language program to machine language.

        e). Debugging :  Finding and correcting of errors in the program

        f). Execution and testing : Running of the program and testing for correctness.

       g). Documentation: It will help to understand the program  for proper usage and modification.

                   Two types of documentations.
     1) Internal documentation : Adding comments in program code etc..
     2) External Documentation: Writing manuals about the program for user help.


Image result for flowchart symbols


Brochure for True IQ

Solved Question and Answers from Textbook & previous Question papers .
For  +1 & +2 




Friday, 23 August 2019

+1] 2. Components Of The Computer System - Previous questions chapter wise



               PLUS ONE COMPUTER APPLICATION

          First Year Computer Application or Computer Science Previous Questions Chapter wise ..


                                         Chapter  2.(3 for CS)Components Of The Computer System




1. Write the full form of HDMI 

  Ans.  High Definition Multimedia Interface   

2. The process of converting source code into object code is called ….. ……. 

 Ans. Compilation

3.  Write an example of an operating system that is a free and open source software

   
1) Linux kernel. The Linux kernel is a prominent example of free and open source software. ...
2) GNU Utilities and Compilers. ...
3) Ubuntu. ...
4) BSD Operating Systems. ...


4.  .. …… is a software used for removing worms and trojans 

Ans. Anti-virus

5. “Central Processing Unit(CPU) is the brain of the computer”.What is the role of   Control Unit(CU) in the CPU

           The Central Processing Unit (CPU) is the "brain" of the computer. It executes instructions (from software) and tells other components what to do. ... The Control Unit deciphers and carries out instructions.

6.USB stands for--------------

Ans. Universal Serial Bus

7. “ e-Waste is one of the major problems which we are facing all over the world”.  Justify the  statement

      Yes. The reason often comes down to their packaging. There is definitely a false sense of security when it comes to our electronics being non-hazardous when they become waste. Part of the problem is the packaging of the devices. Their sleek and appealing exteriors make it hard to see them as waste.

       
8.  Which one of the following CPU register hold the address of the next instruction to be  executed by the processor. 

  a). Accumulator  

  b). Instruction Register(IR) 

 c). Memory address register  

 d). program Counter(PC) 

Ans. d

9. Which one of the following is used to connect a projector to a computer?

 a) USB port 

 b) PS/2 port 

c) Parallel port 

 d) VGA port 

Ans. d

10. Differentiate between a compiler and an interpreter. 

          Compiler is also a language processor that translates a program written in high level language into machine language. It scans the entire program in a single run. If there is any error in the program, the compiler provides a list of error messages along with the line number at the end of the compilation. If there are no syntax errors, the compiler will generate an object file. Translation using compiler is called compilation. After translation compilers are not required in memory to run the program. The programming languages that have a compiler are C, C++, Pascal, etc

              Interpreter is another kind of language processor that converts a HLL program into machine language line by line. If there is an error in one line, it reports and the execution of the program is terminated. It will continue the translation only after correcting the error. BASIC is an interpreted language.

11.  Compare  RAM  and ROM 

          RAM                                                                                                        ROM

1. It is faster than ROM                                                                        It is a slower memory
2 It stores the operating system, application                              It stores the program required to boot       programs and data when                                                           the    the computer  initially
    Computer is functioning                                                                                             
                                             
3. It allows reading and writing.                                                    Usually allows reading only.
4.  It is volatile, i.e. its contents are lost
       when the device is powered off.                                             It is non-volatile


12.  Consider that NSS volunteers of your school have taken up a campaign to educate  your friends in other schools to reduce e-Waste.

a). Write four captions(methods) for     the campaign through which students can reduce the volume of e-waste produced

b). Explain e-Waste disposal methods

c).  Define the term, green - computing. How can you implement green –computing


  Ans. a). Reuse: It refers to second-hand use or usage after the equipment has been upgraded or modified.
 b). Recycling of e-Waste: Recycling is the process of making or manufacturing new       products from a product that has originally served its purpose.
 c). Refuse : Use alternatives if there is or buy only it is necessary. 
d). Incineration: It is a controlled and complete combustion process in which the waste  is burned in specially designed incinerators at a high temperature 
e). Land filling: It is one of the most widely used, but not recommended methods for disposal of e-Waste.

c). Green computing is the designing, manufacturing, using and disposing of computers and associated components efficiently and effectively with minimal or no impact on the environment.   To make computer green,

  a). Green design: Designing energy-efficient and eco-friendly computers, servers, printers, projectors and other digital devices.
 b). Green manufacturing: Minimising waste during the manufacturing of computers and other components 
   c). Green use: Minimising the electricity consumption of computers and peripheral devices and using them in an eco-friendly manner. Minimise  printing and maximize the use of soft copy
 d). Green disposal: Reconstructing or recycling unwanted electronic equipment.

13.  Arrange the following memory storage devices on the base of their speed in  ascending order. 

       a). Hard Disk b). Cache c). RAM d). Registers 

 Ans.     c). RAM
 
            a). Hard Disk

             b). Cache

             d). Registers

14.  Differentiate or define the terms software and hardware in a computer system.  Give one example for each.

        Hardware is the tangible and visible parts of a computer.
        Eg.  Processor, Mother board  etc

     Software is a set of programs that help us to use the computer system  or  electronic  devices               efficiently.             
     Eg.  Operating System, Antivirus etc.

15.  What do you mean by utility software? List any four types of utility software  with their use

     Utility software is a set of programs which help users in system maintenance tasks  and in performing tasks of routine nature. 

 Some examples are,

 a). Compression tools: Large files can be compressed so that they take less  storage area. hese compressed files can be decompressed into its original  form when needed.                 
 Eg. Winzip, 7zip etc.

  b). Disk defragmenter: Disk defragmenter is a program that rearranges files on a   computer hard disk.
 c). Backup software: Backup means duplicating the disk information as a  protection from loss.

d). Antivirus software: Antivirus software is a utility program that scans the   computer  system for viruses and removes them.

16. Explain any five commonly used secondary or (auxilliary) memory devices.

         Different categories of storage devices are magnetic, optical and semiconductor memory.

     i. Magnetic storage devices Magnetic storage devices use plastic tape or metal/plastic disks coated with   Magnetic materials. Data is recorded magnetically in these devices. Eg.  1.    Floppy Disk, 2.    Hard Disk, 3. Magnetic Tape
a). Floppy Disk: It is made up of plastic coated with magnetic material. Its capacity is 1.44 MB.
A floppy drive is used to read the data from a floppy disk. Data will lose when it kept inside a magnetic field or other chemicals, because it coated with magnetic substances.
b). Magnetic Tape:  It can store huge volume of data and cheap. Data is stored in thin tape coated with magnetic material. It is a sequential access medium.
c). Hard Disk: It contains a group of metallic disks, coated with magnetic material in a dust proof case. Each plate has read write head. It has huge capacity from 10 GB to 4 or more  TB. The recordable surface of a disk is divided into number or invisible concentric circles called Tracks. Each track again divided into pie shaped segments called sectors.
ii. Optical storage devices Optical disk is a data storage medium which uses low-powered laser beam to read from and write data into it. It consists of an aluminum foil sandwiched between two circular plastic disks. Data is written on a single continuous spiral in the form of pits and lands. They are classified into three,
a). Compact Disk (CD): It is made up of a layer of aluminum on a plastic plate. Its capacity is 700 MB. It may be CDROM or WORM (write ones read many) or CD R/W. To read and write red beam of laser light is used.
b). Digital Versatile Disc (DVD): It is faster and has more storage capacity than CD. Its capacity is from  4.7 GB to 15.9GB
c) Blue Ray DVD: Used to store High Definition videos and huge amount of data storage. It uses blue-violet LASSER beams  that allows data is packed more tightly.
iii. Semiconductor storage (Flash memory) Flash drives use EEPROM chips for data storage. They do not contain any moving parts. Flash memory is faster and durable when compared to other types of secondary memory.

a). USB flash drive A flash drive is a small external storage device, which consists of flash memory typically the size of a human thumb. USB flash drives are portable and rewritable.

b). Flash memory cards Flash memory card is another type of flash memory. They are flat and small in size.

17.  Compare Dot matrix printer, Ink jet printer, Laser printer and Thermal printer  on the basis of           their working speed, quality of printing, and expense for printing

Characters are formed by the impact of pin sets. When print head moves pins are strike on the paper. They versatile (can print both text and graphics), Print cost is low but low speed, low quality and noisy. But we can change the font settings.

Inkjet printers form the image on the page by spraying tiny droplets of ink from the print head. There is no physical contact between print head and paper. Printing speed is high. It gives high quality with colour printing and it does not produce noise. But the cost of ink cartridges makes it a costly in the long run.

Here carbon powder (toner) acts as carbon ribbon. The image to be printed is transferred to a drum using a laser beam. The toner powder sticks onto the portions traced on the drum by the laser beam. It is transferred to a paper by rolling the paper over the drum.  Printing speed is high. It gives high quality with colour printing and it does not produce noise.

  Thermal printing produces a printed image by selectively heating heat-sensitive thermal paper when it passes over the thermal print head. The coating turns black in the areas where it is heated, producing an image.

18. What are the types of memories used in computer

      Memory is a place where we can store data, instructions and results temporarily   or permanently.      Memory can be classified into two: primary memory and secondary memory.

Primary memory in a computer holds data, intermediate results and results of  ongoing jobs temporarily.  Eg. RAM. (Random Access Memory):  It refers to the main memory that microprocessor can read from and write to. Data can be stored and retrieved at random from anywhere within the RAM.

ROM is a permanent memory that can perform only read operations and its contents cannot be easily altered. ROM is non-volatile; the contents are retained even after the power is switched off.            Eg. Basic Input Output System (BIOS).   
Some modified types of ROM are,
a). PROM   - Programmable ROM which can be programmed only once.
 b).EPROM - Erasable Programmable ROM that can be erased using ultra violet radiation                      and can be programmed using special electronic circuits.
 c).EEPROM - Electrically Erasable Programmable ROM which can be erased and  rewritten electrically.   Eg. Pen Drive

Cache memory is a small and fast memory between the processor and RAM.  It helps to improve the speed and performance of the computer system.

Secondary memory is permanent memory. Secondary memory is much larger in size than RAM, but is slower. It stores programs and data but the processor cannot access them directly. 
  Eg. Hard Disk, CD , ROMs etc.

19. Mr.Rajmohan wants to buy a computer.He is an engineer by profession.He wants  a device to Draw which can be used to ‘draw directly on the screen.

     a)Suggest him an input device.
     b)Suggest him any four practices of green computing

Ans. a) Light pen

          b). green IT includes hardware, software, tools, strategies and practices that improve and promote environmental sustainability. Green IT benefits the environment by improving energy efficiency, reducing greenhouse gas emissions, using less harmful materials, the re-use and recycling is also important.