Header Ads Widget

Module 1: The Programming Process

 

The Programming Process


1. What is a computer program?

A computer program is a group of instructions for a computer that cause it to perform a desired task.


2. What is Programming Process? What are the activities of computer programming process?

The Programming Process is the procedure or Method that is followed in developing and solving a program. 

Computer programming process includes:

i. Defining the problem

ii. Preparing an algorithm

iii. Preparing a program flowchart 

iv. Coding the program

v. Debugging and testing

vi. Documenting 


3. What is input and output?

Input: Input is the operation /(Process) of reading data that is to be read and processed by a program.

Output: Output is the result of processing data by the computer.


4. What things the programmer must carry out before proceeding one activity to the next?

The programmer must carry out checking procedures each time before proceeding to the next activity.


5. What is program flowchart? Why do we use it?

A program flowchart is a symbolic representation of algorithm. 

It is a representation (Symbol) using standard outline of the processing steps to be used to solve a problem.

A flow chart can be used to:

Define and analyze processes.

Build a step-by-step picture of the process for analysis, discussion, or communication.


6 . Who provides the definition of the problem to the programmer?

The definition of the problem is usually provided to the programmer by a systems analyst.


7. Who is a System Analyst?

A system analyst is the person who plans the collection of equipment (tools), programs, people and, the procedure that make up a system.


8. What do you mean by POSITIVE, NEGATIVE and ZERO numbers?

Positive Number: A positive number is a number that is bigger than zero

Negative Number: A Negative number is a number that is less than zero

Zero Number: Zero is a number that describes no quantity or null quantity.


9. Write down the computer’s limited capabilities.

i. A computer can perform arithmetic operations; usually limited to addition, subtraction, multiplication and division.

ii. It can compare two thing and on the basis of the result of the comparison, choose among alternative courses of action.

iii. It can move data about in its memory.

iv. The computer can also input data and output result.


10. What do you know about Program Flowcharting outline?

Program Flowcharting outlines are a representation using standard outlines of the processing steps to be used to solve a problem.


11. What do you know about Debugging and Testing?

The programmer's output must be carefully examined to ensure that it is correct. If it is not, the source of problem must be identified and corrected. The process of detecting and correcting errors is referred to as testing and debugging.


12. What are compiler, assembler, generator & interpreter?

Compiler: A Compiler is a program that translates a source program instruction into one or more object program instructions.

Assembler: Assembler is a low level language. An assembler is a type of computer program that interprets software programs written in assembly language into machine language, code and instructions that can be executed by a computer.

Generator: Generator is a translator program designed to create object program. A generator is a special routine that can be used to control the iteration behavior of a loop.

Interpreter:  An interpreter is a computer program that directly executes instructions written in a programming or scripting language.


13. What is Counter?

Counter: A counter is a device for keeping track of the number of items something occurs.


14. What do you know about Desk-Checking an Algorithm?

Desk checking is a reviewing process in which a representative sample of data is manually processed through an algorithm, flowchart, pseudocode, or coded program to locate logic errors.


15.  Write down five Flowcharting Guidelines.

i. A flowchart should be read the way a printed page is read  from top to bottom and from left to right.

ii. Every program flowchart starts with a single terminal outline and ends with one or more terminal outlines.

iii. The descriptive names that identify data items being used and the operation being performed should be used consistently.

iv. The words used inside the outlines should be chosen so that they will have meaning for anyone reading the flowchart.

v. The contents of a decision outline should consist of the two items being compared.


16. What are the High level languages?

A programming language in which one source program instruction may be translated into one or more object program instructions is called a high-level language. Hi-level are most widely used as they are easy to learn. Programs written in a high level language for one computer can easily be used on another computer with only minor modifications.


17. What is logic Error?

Logic Error is an error that occurs as a result of faulty reasoning. It can not be detected by a translation program, but will produce incorrect result.


18. What is Syntax Error?

Syntax Error is the violation of the rule of a particular programming language being used.


19. What do you understand by Execution-time-error?

Execution-time-error is an error, detected during execution of a program that is such a severe nature that execution cannot be continued.


20. Define the following Keywords: 

Algorithm: An Algorithm is the sequence of steps that describe a method for solving problem.

ANSI: ANSI stands for American National Standards Institute.

BASIC: BASIC stands for Beginner’s All-Purpose Symbolic Instruction Code. Basic is widely used on personal computer.

Binary: Binary refers to a numbering system that represents all values with a combination of one’s (1s) and zeros (0s).

Branch: Transfer control to another part of a program.

Bug:  An error in computer program.

Character: A letter of the alphabet, a digit, or a special character ( $, %, +, etc).

Characters: Characters are letters, numbers or special symbols, such as a comma, dollar sign or decimal point.

COBOL: COBOL stands for Common Business Oriented Language for business data processing requirements.

Coding: Writing instruction for a computer to perform a particular task.

CRT: CRT stands for Cathode Ray Tube.

Debugging: Removing the error s from a program.

Desk checking: A reviewing processes in which a representative sample of a data is manually processed through an algorithm, flowchart, pseudo code, or coded program to locate logic errors.

Documenting: Preparing a written record of all activities associated with the programming process.

EOF: End-Of-File condition. In computing, end of file is a condition where no more data can be read from a data source while reading file.

Execute: Cause a program or group of instruction.

Field: A collection of characters used to represent a unit of information about an entity; a subdivision of record. Also referred to as an item.

FORTAN: Fortran (previously known as FORTRAN) stands for FORmula TRAnslator. IT is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing. It was originally developed by IBM in the 1950s for scientific and engineering applications.

File: A collection of related records..                                                           

Increment: Increase the value of a counter.

Initialize: Define an initial value for a field, e.g., set a counter or total field to zero.

Input: Data that is to be read and processed by a program; the operation of reading such data.

Item: A collection of characters used to represent a unit of information about an entity; a subdivision of record. Also   referred to as an item.

Listing: Output on a printer

Logic error: Logic error is an error that occurs as a result of faulty reasoning. It cannot be detected by translation program but will produce incorrect result.

Loop: A loop is a sequence of instructions that is continually repeated until a certain condition is reached. When the condition is reached, it causes the control to be transferred to the instruction following the loop.

Memory: A portion of the computer in which data, instructions, and the results of processing can be stored.

Object Program: Object program is a computer program which is translated from the equivalent source program into machine language by the compiler or assembler.

Output: That result of processing by the computer; the process of producing such  results.

Pascal: Pascal is an influential imperative and procedural programming language, designed in 1968–1969 and published in 1970.

Record: A record is a collection of data that pertains to a particular entity in a file.

RPG II: RPG stands for Report Program Generator. Its a Powerful Programming language for business application, widely used on smaller business computers.

Run: Cause a program or group of instruction.

Testing: Running a program with sample data to identify logic errors..

Translation Program: A program that converts a source program into machine-language object program. It also provides a listing of the source-program and diagnostic message.

VDT: VDT stands for Visual Display Terminal.


21. What is detail line and total line?

Detail line: A printed line in a report that contains information about a single entity is called a detail line.

Total Line: A line that summarizes data obtained from one or more input records.


22. What is interpreted program?

Interpreted program is a program whose instructions are actually a logically sequenced series of operating system commands, handled one at a time by a command interpreter.


23. What is documenting?

Documenting means preparing a written record of all activities associated with the programming process.


24. Why do we use compiler?

We need to use the compiler because computers cannot understand coherent human language, and humans cannot understand coherent computer language. Compilers are like translators that convert human-readable/writable code into assembly code, which is very difficult to understand and use.


25. What is source program?

Source Program are instructions for computer written in a form that is relatively easy for the programmer to work with, but must be converted to a machine language by a translation program before it can be run on a computer.


26. Write An Initial Algorithm step’s for a problem: How many positive, negative and zero numbers are there in a list of numbers.

An Initial Algorithm step’s are:

i. If the number is positive, add one to the positive counter.

ii. If the number is negative, add one to the negative counter.

iii. If the number is zero, add one to the zero counter.


27. Write Refining the Algorithm step’s for the problem: How many positive, negative and zero numbers are there in a list of numbers.

i. Read a number; if there are no more numbers, go to step 5.

ii. If the number is positive, add one to the positive counter and go to step 1.

iii. If the number is negative , add one to the negative counter and go to step 1.

iv. If the number is zero, add one to the zero counter and go step 1

v. Print counter.


28. Write down the steps for a number’s algorithm for the problem: How many positive, negative and zero numbers are there in a list of numbers.

Numbers algorithm:

i. Set positive, negative and zero counter to zero

ii. Read a card; if there are no more numbers, go to step 6

iii. If the number is positive, add one to the positive counter and go to step 2

iv. If the number is negative , add one to the negative counter and go to step 2

v. Add one to the zero counter and go to step 2

vi. Print counter

vii. Stop.


29. Prepare a desk-checking numbers algorithm by following set of numbers for the problem:  How many positive, negative and zero numbers are there in a list of numbers. 

  15, 4,-2,-3, 0, 0


30. Write any five names and purposes of programming language?

Name of five Programming language and their purposes:

BASIC(beginner’s all purpose symbolic instruction code): BASIC was originally developed for students to solve algebraic problems but it has been modified to handle business data processing also. It is widely used on personal computers.

COBOL (COmon Business Oriented Language): Designed for business data processing requirement s, originally used for large computers.

FORTAN (FORmula TRANslatot): Designed for mathematical problem  solving.

RPG II(Report Program Generator): Easy to learn language for business application .

Pascal: A general purpose programming language designed with the needs of structured programming in mind.


31. Write the difference between compiler and interpreter.

The main differences between compiler and interpreter are listed below:

The interpreter takes one statement then translates it and executes it and then takes another statement; while the compiler translates the entire program in one go and then executes it.

Compiler generates the error report after the translation of the entire page while an interpreter will stop the translation after it gets the first error.

Compiler takes a larger amount of time in analyzing and processing the high level language code; comparatively interpreter takes lesser time in the same process.

Besides the processing and analyzing time the overall execution time of a code is faster for compiler relative to the interpreter.


32. Write about Compiler and Interpreter.

Compiler:

i. If a compiler is used, the entire program is processed as a unit.

ii. Checks for Syntax Error and produce a list a detected syntax error.

iii. If Syntax error is detected, then the compiler will go no further.

iv. If there is no syntax error then, it checks the generated output. If output is incorrect then, the programmer checks the logical error. When the errors have been corrected, the program is resubmitted to the compiler. generator or assembler and the process of correcting the errors are repeated.

Interpreter:

i. Each instruction is checked as it is entered.

ii. If the Instructions contain syntax error, they are corrected and reentered.

iii. Instructions without errors are executed immediately.

iv. Resulting output is examined for logical error.

v. Logical errors are corrected and interpreted and executed again.

vi. This process continues until all bugs have been removed.

vii. No object program is produced.


33. Write algorithm and flowchart of the following problem:

A) Find the largest and smallest number from the list of numbers 

i. Read a number if there no number go to step 7

ii. Set largest and smallest to number

iii. Read a card; if there are no more number go to step 6

iv. If the number is greater than largest set largest to number and go to step 3

v. If the number is smaller than smallest set smallest to number and go to step 3

vi. Print largest and smallest

vii. stop

B) Count the total even numbers and odd numbers from the list of numbers   

i. Set Even and Odd equal to 0

ii. Read the list; if there are no more number, go to step 5

iii. If number is divide by 2 & no remainder, add one to  the even counter and go to step 2

iv. Add one to  the Odd counter and go to step  2

v. Print

C) A file containing the records of product id and product price is given. Calculate the MRP value of the product after adding 1.5% vat with the product price.  

i. Initialize MRP to 0 

ii. Read the file, at EOF go to  step  8

iii. Multiply price by 1.5 and store into a

iv. Divide a by 100 and store into c

v. Add c to product price 

vi. Print the results.

vii. Go to step 2

viii. Stop

D) Find the largest number of a, b and c.

i. Read three numbers a, b, c

ii. If a is greater than b and c than the largest number is a

iii. If b is greater than a and c than the largest number is b

iv. C  Is the largest number

v. Stop

E) Calculate the summation from 1-100 

i. Initialize total to 0 and to 1

ii. Add total by n

iii. Increment n by 1

iv. If n is less than 100 than go to step 2

v. Print total

vi. Stop

F) Find those numbers from 50-100 which are divisible by 5 

i. Set n equal to 50

ii. Divide n by  5 and set the remainder  value to R

iii. If R is 0 than Print n

iv. Increment n by 1

v. If n is less than 101 than go to step 2

vi. Stop


Post a Comment

0 Comments