Sunday, March 31, 2013

Ques:What is the difference between data & information?

The difference between data & information is given below:

There are three answer.You can accept one or all of them.


                                                      Answer No:1
1.The concept of data: numbers, text, pictures, sound and moving images.

The concept of information: the information is useful data.

2. Data is the part of information.

Information contains data.

3. But data is unprocessed material.

Information is the results of data processing.

4.Data isn’t relative and timeliness.

But Information is relative and timeliness.

                                          
                                                                Answer No:2
                                               
1.The information is a reflection of the objective things property. Impact is after data processing and objective of human behavior manifestations.

The data reflect the objective things, property records, is concrete manifestation of information.

2. Anything properties are expressed through data. Data become information after intensive processing.
The information must be spread through the data in order to influence on human.

3. For example: Data 1, 3, 5, 7, 9, 11, 13, it is a set of data, if we analyze it can be drawn that it is an arithmetic sequence, we can easily know the figures behind it is a message. It is useful data 1,3,2,4,5,1,41 data. It can not tell us anything, so it is not information.



                                                         Answer No:3

1. Information: objective world and a state of movement, and its state changes reflect, can be passed, is useful.

Data: is the recording of the objective facts of the physical symbol or a combination of these physical symbols.
2.The data itself has no specific meaning, just record the nature of things, shape, number of features abstract symbols.

Information is obtained after the useful data processing and it has specific meaning.

3.Example: Data  is like a someone’s poker face, information is like someone’s smiling face. 


Wednesday, March 27, 2013

Ques: What do you mean by operator and operand? What are unary operators? How many operands are associated with a unary operator?

The definition of operator ,operand and unary operator is given below.

Solution:

Operator: C is very in built-in operators.An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.

Operand: The data items that operators used are called operand.

Unary operator: C includes a class of operators that act upon a single operand to produce a new value.Such operators are known as Unary operator.

Unary operator are below:

+ + ( Increment).
- - (Decrement).
- (unary minus ).

How many operators are associated with a unary operator: Only one operator is associated with a unary operator.Such as....


a++ ......here is one operand.
++a .....here is one operand.

Ques: What do you mean by token? Classify the c token?

Solution:


Token: We write a program with a programming language C.Then this program contains some words (a-z,0-9,........),some special words(#,%,.......),bracket,punctuation etc.Every each group is called token.



Classification of C token:

There are six types of token in C.


1.keywords......(do, if, auto,while,.....)

2.identifiers......(num, sum,......) 

3.constants.....(const pi=3.1416)

4.string constants....("bangladesh")

5.operators and expressions.....(a=b+c,....)

6.punctuators......(; , . , .........)

Friday, March 1, 2013

Ques-12:Define keyword or reserved word.What restriction apply to their use?

The definition of keyword or reserved word and restriction apply to their use is given below.

Solution:

Keyword or reserved word: In computer programming ,a keyword or reserved word is a word or identifier that has a particular meaning to the programming language.In C, there are certain reserved word, called keyword that have a standard pre-defined meaning.



Restriction to apply keyword: The keywords can be used only for their intended purpose.They cannot be used as programmer defined identifiers.The keywords are all lowercase.Since uppercase and lowercase character are not equivalent, it is possible to utilize an uppercase keyword as an identifier.Normally,this is not done , as it considered a poor programming practice.

Wednesday, February 27, 2013

Ques-11: Define identifier and describe the rules of identifier.

The definition of identifier and the rules of identifier is given below.

Solution:

Identifier: The names that are used to reference variables ,functions ,arrays ,labels and various other user-defined objects are called identifiers.


Rules of identifier:

1. An identifier name can vary from 1 to 32 characters.
2. The first character must be a letter or an underscore( _ ) with subsequent characters.
3. An identifier name cannot be the same as a C keyword and it should not have the same name as functions that are in the C library.
4. Must not contain white space.
5. In C,uppercase and lowercase are treated differently .Hence, count,Count and COUNT are three different identifier name.

Ques-10: What is variable? Where is it used?

The definition of variable and where it is used is given below.

Solution:

Variable: A variable is a named location in a memory that is used to hold a value that can be modified by the program.All variable must be declared before they can be used.

General form of variable declaration is -

                                                                      type_variable list;

Here type must be a valid C data type  and variable list may consist of one or more identifier names separated by comma (,).

         int i;
         double balance,profit,loss;


 Where it is used:

There are three basic places where variables are used.

1. Inside the funtion
2. In the definition of the function.
3. Outside of the function.

Ques-9: What is the difference between compile time error and Run time error?

The difference between compile time error  and Run time error is given below.

Solution:

Compile time error: Compile time error happens when the program is being compiled.Generally,compile time errors are syntax errors and they are caught by the compiler.An example of a compile time error might be leaving out a semi-colon in C.Compile time errors tend to be syntax errors.


Run time error: Run time errors  occur at run time .Generally,the program compiles but does not run correctly.An attempt to read past a null pointer in C would be an example of a run time error.Run time errors tend to be logic errors.

Ques-8: What do you mean by compile time and Run time?

The ques-8 solution is given below.

Solution:

Compile time: The time during which a program is being compiled.A common occurrence during  compile time is syntax error.

  Run time: The time during  which a program is executing.


Ques-7: What is the difference between compiler and interpreter?

The ques-7 solution is given below.

Solution:

Compiler:

1. Compiler translates a whole program from source code to object code if any wrong is not  found in the      code or program.
2. Compiler catches all wrong of a program together.
3. Lower execution time.
4. Requires higher program development effort and time.
5. It is more popular.
6. Compiler is used in PASCAL,C,C++  etc


Interpreter:

1. Interpreter translates and immediately executes each line of the program.
2. Interpreter catches the all wrong of a line together.
3. Higher execution time.
4. Requires less development effort and time.
5. It is less popular.
6. Interpreter is used in BASIC, DBASE,JAVA etc..

Tuesday, February 26, 2013

Ques-5: What is an Assembler? What is the difference between an Assembler and a Compiler?

The ques-5 solution is given below.

Answer:

Assembler: Assembler is a software or a tool that translates Assembly language into machine code.


The difference between an Assembler and a Compiler is given below.

Assembler:

1. Assembler is a computer program that reads code written in one language which is called Assembly language and translates into machine language.
2. Assembler is used in low-level Assembly language.
3. Assembler is less popular than compiler.


Compiler:

1. Compiler is a computer program that reads code (like C,C++ code )and translates into machine language.
2.  Compiler is used in high-level language.
3. Compiler is more popular than Assembler.

Ques-4: What is Assembly language? What is the problem of Assembly language?

The ques-4 solution is given below.

Answer:

Assembly language: Assembly language is a low-level programming language using the human readable instructions in the CPU.In PCs , the Assembly language looks like this,

  mov ebx,eax
  mov esi,66
  mov [edx+ebx*4+4],ecx
  mov [ebx],ah

To compile this code into machine code ,a compiler is needed.Assembler is the compiler for the Assembly language.


Problem of Assembly language: The problem with Assembly language is that it requires a high level of technical knowledge and it's slow to write.In the same time that you take to write ten lines of Assembly language- that's ten instructions,you could write ten lines of C++, perhaps the equivalent of 500 instructions.

Ques-3:What is machine language? How does machine language differ from high level language?

The ques-3 solution is given below.

Answer: 

Machine language:  Machine language is the name of the instructions that a CPU can execute.It is the translation of source code.Compilers generate machine language from source code.This language depends on 1 and 0.


The difference between machine language & high level language is given below.

Machine language:

1. Machine language is first generation language(1GL) .
2. It's bassed on 1 and 0.
3. There is no need of translation.
4. Not compatible with human language and human throught process.
5. Machine language is called the object program.


High-level language: 

1. High-level language is third generation language(3GL).
2. It's bassed on similar to english language( C, C++, BASIC, JAVA  etc ).
3. Must be translated into machine language before it can be executed.
4. More compatible with human language and human throught process.
5. High-level language is called the source program.

Friday, February 15, 2013

Ques-1:What is the of definition of Source code & Object code?

The ques-1 solution is given below.

Answer:

Source code:  Source  code is the human readable instructions that a programmer writes.Here is an example of C source code.


void main()
{
   float  radius, area;
   printf( "  radius=? " );
   scanf( " %f " ,&radius );
   area=3.1416*radius*radius;
   printf( " The area of the circle is=%f ",area);
}




Object code:  Object code is name of the instructions that a CPU can read and execute directly.It is also called Machine code.


Thursday, February 14, 2013

Ques-6: What is a Compiler & Interpreter?

The ques-6 solution is given below.


Answer:

Compiler:  A  compiler is a computer program that transforms human readable source code into a machine readable code that a CPU can execute.

The act of transforming source code into machine code is called  " Compilation".





Interpreter:  An interpreter is a computer program that takes a line of code, translates and executes it into machine code and then goes on to the next line.


The act of transforming source code line by line into machine code is called " Interpretation".

Ques-2:What is the difference between Source program & Object program?.

The ques-2 solution is given below.

Answer:   

Source program and Object program are two types of programs found in computer programming.The difference between Source program & Object program is given by below.



Source program:



  1. Source program is typically a program which is human readable instructions written by a programmer.
  2. Source program is written in higher level languages such as Java or C.
  3. Source program are easily readable by humans.


Object program: 
       
  
  1.  Object program is typically a machine executable program created by compiling a source program. 
  2. Object programs usually contain lower level languages such as Assemly language or machine code.
  3. Object programs aren't easily readable by humans.