PLUS ONE
COMPUTER APPLICATION / COMPUTER SCIENCE
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.
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. 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.
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