Chapter 1 Introduction to programming short Questions Answer (M3-R5)

o level python it computer guruji

1)- Discuss the advantages of assembly language over machine language? 

ANS)- Advantage of assembly language over machine language are follows:

a)- Programs can easily written in alphanumeric symbols instead of 0’s and 1’s.Meaingful and easily rememberable symbols are selected for this purpose. For example, ADD for addition, SUB for subtraction, CMP for comparison, etc. Such symbols are known as mnemonics.

b)- Writing programs in assembly language saves programmer’s time. Fewer errors are made, and those that are made are easier to locate. Thus, writing of program in assembly language is easier and faster as compared to writing programs in a machine language.

c)- Modification of assembly language programs is easier than machine language program.

2)- Differentiate between syntax errors and run time errors?

ANS)- Syntax error messages-

Syntax or compilation error, are detected and displayed by the complier as it attempts to translate our program. If a statement has a syntax error, it cannot be translated and our program will not be executed.

b)- Run time error message-

Runtime errors are detected by the computer and displayed during execution of the program. The runtime errors occurs when the program directs the computer to perform an illegal operation, such as dividing a number by zero. When runtime error occurs, the computer will stop executing our program and will print a diagnostic message that indicates the line where the error was detected.

3)- Write the name of few high-level programing language?

ANS)- Example of latest high-level language are java, c, c++, python, visual basic, Delphi, perl, ruby, PHP, etc.

4)- What do you understand by compilation and execution of a program?

ANS)- To translate the sources code of a program written in a high-level language into object code prior to execution of the program is known as compilation.The program that performs this task is known as compiler. Now, the object code made after compilation, is linked with other library codes which are needed for execution of the program, The resulting code is known as executable code. After successful compilation, we get file with .exe is created after executing the .exe file, the result is obtained.

5)- What do you mean by documentation of a program? what is the importance of documentation?

ANS)- Documentation of a program involve collecting, organizing, storing and maintaining a complete historical record of programs and other documents used or prepared during different phases of the system development. The main aim of documentation are as follows:

(a)- To make available a clear description of the work done so far and help in the design of the system by working to a set of standards. The documentation needs to be kept up to date throughout the project.

(b)- Good documentation ensures that everyone involved in the system design (namely system designers, programmers and users) fully understands how their part of the system will work. For example, what data will be inputted and how, and what information will be available from the system.

6)- How do syntax error occur? explain with an example.

ANS)- Syntax errors are caused by invalid syntax, for example, entering print instead of print in python. Since a translator cannot understand instructions containing syntax errors, it terminates when it encounters such errors, indicating the place where in the program, the problem has occurred.

7)- differentiate between interpreter and complier?

(a)

Translates programme one statement at time

Scans the entire program and translates it as a whole into machine.

(b)

It takes less amount of time to analyze the source code, but the overall execution time is slower.

It takes large amount of time to analyze the source code, but the overall execution time is comparatively faster.

(c)

No intermediate object code is generated; hence, it is memory efficient.

Generates intermediate object code which further requires linking; hence, it requires more memory.

(d)

Continues translating the program until the first error is found, in which case it stops. Hence, debugging is easier.

It generates the error message only after scanning the whole program. Hence, debugging is comparatively harder.

(e)

Programming language like java, python and ruby use interpreters.

Programming language like c and c++ use complier.

8)- what do you mean by semantic error (logical errors)? explained with example.

ANS)- Semantic error (logical error) are error in program logic. such error cannot automatically be detected, since, translators do not understand the intent of the given computation. For example, if a program computed the average of three numbers as:

(num1+num2+num3)/2.0

The translator would have no means of determining that the divisor should be 3, not 2. Computers do not understand what a program is meant to do, they only follow the instructions given. It is up to the programmer to detect such error.

9)- what is program maintenance?

ANS)- Program maintenance covers a wide range of activities, including correcting coding and design error, updating documentation and test data and upgrading user’s support. In other words, maintenance may be viewed as enhancements i.e. Adding, modifying or developing the code to support change in the specification.

10) What is pandas library of python what is its significance?

ANS)- Pandas library in python is used for data analysis. It makes available various tools for data analysis and make it simple and easy process

Post a Comment

0 Comments