Home » Question in Chapter 1

Question in Chapter 1

Short Term Question-Answer:

  1. Errors in the Program are called bugs.
  2. Testing is a process that detects and removes the program errors.
  3. Program Designing have which of the following approach/approaches?
    1. Top down design
    2. Bottom up design
    3. Structural design
    4. All of these
  4. Program is a set of instructions.
  5. Low level language is also called machine level language.
  6. High level Language are machine independent.
  7. Compiler converts whole program into machine code and create an executable file.
  8. Interpreter converts source code into machine code line by line and then executable file created.
  9. Error removing are called debugging.
  10. Which of the following is/are basic tools for designing a program.
    1. Algorithm
    2. Flowchart
    3. Both (1) & (2)
    4. None of these

Long Term Question-Answer:

Ques 1. What are the various steps in the development of a program?
Ans:- The various steps for development of a program are given below :

  1. Requirement Analysis
  2. Designing The Algorithm
  3. Algorithm Development and Flow Charting
  4. Coding
  5. Debugging and Compilation
  6. Testing
  7. Implementation and Documentation

1. Requirement Analysis : The basic step for development of a program is requirement analysis. This process is helpful for understanding the problems and doing whole work step by step to solve the problem. In this process, the programmer first takes a look at the problem then prepares the program specifications and collects data from the people concerned. For the information gathering, there are various tools like interviews, questionaries, site observations, review of manuals reports etc. Studying a problem is also necessary because it helps a programmer to decide about the following things:

  • The facts and figures which are necessary for developing the program.
  • The way in which the program will be designed.
  • The language in which the program will be most suitable.
  • What is the desired output and in which form it is needed etc.

2. Designing: Once a problem is clearly understand, its solution procedure is designed. The design phase depends on different input formats, different output forwards and coding stages. All the stages should be properly designed like :

  • Data Structures : Defines the format and type of data the program will be used .
  • User interface : It covers the designing of screen, how data will enter and how to display the data.
  • Inputs : It defines how to data enter.
  • Outputs : It defines how to display output of a program.

3. Algorithm Development and Flow Charts : When designing phase is finished, the next work related to algorithm and flow chart gets started. An algorithm is a step by step solution procedure of any problem. Algorithm is written in very simple language. It shows the logical sequence of actions. The programmer designs an algorithm to help visual possible alternatives in a program also. Flow Charts are graphical representation of any problem. It shows all the modules in a proper hierarchy form.

4. Coding : The next step after algorithm development and flow charts is to write the program in a high-level language. This process is known as coding. A good programmer will consider the following :

  • Code Reliability
  • Future Maintenance
  • Documentation

5. Debugging and compilation : Once the program is developed, it must be checked that is completely error free. The main possible types of the errors are:

  • Syntax error
  • Logical error
  • Execution error

Debugging is a process of detecting, locating and correcting the errors in a program.

Compilation is a process in which the source program is converted into an object program. Source program is written into high level language and object program is written into machine language. It converts whole program at once and after the errors are removed, program will execute and result will show.

6. Testing : When the program are developed, then testing process starts. For the testing some data are taken and then output is calculated manually. After that same data is given through the program, then its result is match with manually calculated output.

7. Implementation and Documentation : When the program are implemented properly, then a software will be complete. When the program is finalized, its documentation is prepared. Final documentation is provided to the user. It guides the user how to use the program in the most efficient way.

Also, another purpose of documentation is to allow other programmers to modify the code if necessary. Documentation means the collecting, organizing, storing and maintaining a complete record of the development software.

Ques 2. What are the various computer languages?
Ans:- A computer language is a method of communication with a computer.

Just as humans use language to communicate, and there are different languages in different areas, computers also have their own languages which are specific to them.

Different types of languages have been developed to perform various types of work on computers.

Types of Computer Languages:

  1. High Level Language
  2. Machine Language
  3. Assembly Language

High Level Language

  • A high level language are machine independent.
  • A high level language is a programming language, may be English-like.
  • Easy to use.
  • More portable across platforms.

Machine Language

  • Machine languages are only languages understood by computers.
  • Machine languages are impossible to use and understand by the user or human being.
  • Programs written in high level languages are translated into assembly languages or machine languages by compiler or interpreter.
  • Every CPU has its own unique machine language. Programs must be rewritten or recompiled, to run on different types of computers.

Assembly Language

  • Assembly language programs are translated into machine language by a program called an assembler.
  • Assembly language is one level above machine language. It uses short mnemonic codes for instructions and allows the programmer to introduce names for blocks of memory that hold data.
  • Assembly language is designed to be easily translated into machine language.

Ques 3:- What is Flowcharts and rules for constructing Flowchart?
Ans:- A flowchart is a schematic representation of an algorithm or process. A flowchart is one of the seven basic tools or quality control, which also includes histogram, control chart, scatter diagram etc.

A flowchart is defined as a pictorial representation describing a process being studied or even used to plan stages of a project.

Rules for construction of a Flowchart :

  • Defines the boundaries of the process clearly.
  • Use the simplest symbols possible.
  • Make sure every feedback loop has an escape.
  • There is usually only one output arrow out of a process box.
  • If complexity increases then connectors can be used to reduce the number of flow lines.
  • Do not chart every detail.

Ques 4:- What is Interpreter, Compiler, High Level Language, Machine Language and Assembly Language?
Ans:-

Interpreter 

Interpreter converts source code written in High level Language into machine code line by line and then created executable file.

An interpreter may be a program that either

  1. executes the source code directly.
  2. translates source code into some efficient intermediate representation or code and immediately executes this.
  3. explicitly executes stored pre-compiled code made by a compiler which is a part of the interpreter system.

A program that executes instructions written in a High-level language. An interpreter translates High level instruction into an intermediate form, which it then executes.

Compiler

A compiler is a computer program that translates source code or program written in High level Language into machine code and created an executable file. The original sequence is usually called the source code and the output called object code. Commonly the output has a form suitable for processing by other programs, but it may be human readable text file.

High Level Language

  • A high level language are machine independent.
  • A high level language is a programming language, may be English-like.
  • Easy to use.
  • More portable across platforms.

Machine Language

  • Machine languages are only languages understood by computers.
  • Machine languages are impossible to use and understand by the user or human being.
  • Programs written in high level languages are translated into assembly languages or machine languages by compiler or interpreter.
  • Every CPU has its own unique machine language. Programs must be rewritten or recompiled, to run on different types of computers.

Assembly Language

  • Assembly language programs are translated into machine language by a program called an assembler.
  • Assembly language is one level above machine language. It uses short mnemonic codes for instructions and allows the programmer to introduce names for blocks of memory that hold data.
  • Assembly language is designed to be easily translated into machine language.

Ques 5:- What is Testing and Debugging. Also, write down the difference between Testing and debugging?
Ans:-

Testing

Testing is a process of finding bugs or errors in a software product that is done manually or automated by tester.

Testing is a process that can be systematically planned and specified. Testing can be done at all stages of module development: requirements analysis, interface design, algorithm design, implementation, and integration with other modules.

Debugging

Debugging is a consequence of a successful testing.

Debugging is a process of fixing the bugs found in testing phase. Programmer or developer is responsible for debugging and it can be done by only manually.

The debugging process begins with the execution of the test case. The debugging process will always have one of the two outcomes:

  • The cause will be found and corrected.
  • The cause will not be found.

Difference between Testing and Debugging

Testing Debugging
1.      The purpose of testing is to find bugs and errors. 1.      The purpose of debugging is to correct those bugs found during testing.
2.      Performed by testers 2.      Performed by developer or development team
3.      Can be done manually or automatically 3.      Can only be done manually
4.      Most of the testing can be done without design knowledge. 4.      Debugging can’t be done without proper design knowledge.
5.      Can be predefined when starting testing. The test result could be predicted 5. Start with unknown conditions and it is hard to predict the result
6.      Find the programming failure 6. Demonstrate that it’s only an unattended small mistake

Leave a comment

Your email address will not be published. Required fields are marked *

‘C’ Practical

  1. To get fomiliar with the structure of a ‘C’ program and print “Hello World!” on computer screen.
  2. To perform addition, subtraction, multiplication and division operations on two integers.
  3. To use unformatted 1/0 functions (getchar() and putchar(), gets() and puts()).
  4. To use scanf() function to read integers (%d, %i, %o, %u, %x), characters (%c), floating point numbers (%f, %g, %e), strings (%s, scanset).
  5. To use printf() function to format and print output (%d, %i, %o, %u, %x, %e, %E, %f, %g, %c, %p, %c, %s, %n)
  6. To change width, precision and alignment of the output of printf().
  7. To perform and, or, not, exor, left-shift and right-shift operations on integers.
  8. To check whether a given integer is even or odd (if … else statement).
  9. To write month name corresponding to a month number (switch … case).
  10. To check whether a given integer is prime using while loop.
  11. To reverse the digits of a given positive integer using while loop.
  12. To generate the multiplication table of a given integer using for loop.
  13. To generate first n terms of Fibonacci series using do-while loop.
  14. To compute factorial of a given integer using for loop.
  15. To compute sum of elements of a one dimensional integer array.
  16. To find the largest element in a one dimensional array.
  17. To perform matrix addition and matrix multiplication using 2-D arrays.
  18. To convert the alphabetic characters of a string to uppercase.
  19. To find the length of a string.
  20. To use Standard Library String Functions (strcat(), strrev(), strcp(), strcmp())
  21. Writing a function to find sum of two integers.
  22. Writing a function to swap value of two integers (call by reference).
  23. Writing a function to compute factorial of a given integer (using recursion).
  24. To read and print multiple data items (roll_no, name, branch, semester etc.) pertaining to an individual student.
  25. Demonstrating the use of union
  26. Demonstrating the use of address and dereferencing operators
  27. Performing pointer arithmetic to manipulate an array
  28. To read the contents from a file and display it on screen
  29. To read names and addresss of persons and write them into a file.
  30. Write a program to read the contents of two different files and write it into the third file.