4
CLASS 1 Computer programming Computer programming (often shortened to programming or coding) is the process o f problem identification,analysis, designing, writing, testing, debugging, and m aintaining the source code of computer programs. What is Logic Logic is the formal systematic study of the principles of valid inference and co rrect reasoning. or The science of reasoning, the process of argument. PROBLEM IDENTIFICATION One must know what the problem is before it can be solved. ANALYSIS what must be done to solve the problem? Analysis is detailed study of the various operations performed by a system and t heir relationshipswith in and outside of the system. during analysis ,data are collected on the available files. DFD,interview, on-site observations and questionaries are examples. DESIGN The term design describes a final system and the proces by which it is develope d key question-- How should the problem be solved? Geneal design,Specifications,input,output,files,procedures. CODING A program tool an language is decided. The decision depends on the nature of the software. Design is converted into program. TESTING AND DEBUGGING So long as computers are programmed by human beings computer programs will be su bject to errors. program errors are known as bugs and the process of detecting and correction the se errors is called debugging. Testing is the process of making sure that the program performs the intended tas k, and debugging is the process of locating and eliminating program errors. IMPLEMENTATION It is primarily concerned with user training, site preparation, and file convers ion. . MODIFICATION AND MAINTENANCE After the installation phase is completed and the user staff is adjusted to the changes created by the candidate system, evaluation and maintenance begin. Aging process - New information is inconsistent with the design ALGORITHMS AND FLOWCHARTS ALGORITHMS An algorithm is a specific set of instructions for carrying out a procedure or s olving a problem.

class1

Embed Size (px)

DESCRIPTION

class

Citation preview

�CLASS 1

Computer programmingComputer programming (often shortened to programming or coding) is the process of problem identification,analysis, designing, writing, testing, debugging, and maintaining the source code of computer programs.

What is LogicLogic is the formal systematic study of the principles of valid inference and correct reasoning. orThe science of reasoning, the process of argument.

PROBLEM IDENTIFICATIONOne must know what the problem is before it can be solved.

ANALYSISwhat must be done to solve the problem?Analysis is detailed study of the various operations performed by a system and their relationshipswith in and outside of the system.during analysis ,data are collected on the available files.DFD,interview, on-site observations and questionaries are examples.

DESIGNThe term design describes a final system and the proces by which it is developedkey question-- How should the problem be solved?Geneal design,Specifications,input,output,files,procedures.

CODINGA program tool an language is decided. The decision depends on the nature of the software.Design is converted into program.

TESTING AND DEBUGGINGSo long as computers are programmed by human beings computer programs will be subject to errors.program errors are known as bugs and the process of detecting and correction these errors is called debugging.

Testing is the process of making sure that the program performs the intended task, and debugging is the process of locating and eliminating program errors.

IMPLEMENTATIONIt is primarily concerned with user training, site preparation, and file conversion..MODIFICATION AND MAINTENANCEAfter the installation phase is completed and the user staff is adjusted to the changes created by the candidate system, evaluation and maintenance begin.Aging process - New information is inconsistent with the design

ALGORITHMS AND FLOWCHARTS

ALGORITHMSAn algorithm is a specific set of instructions for carrying out a procedure or solving a problem.

Example1.doc:/* Algorithm for comparison of two nos*/

FLOWCHARTSA flowchart is diagrammatic representation can give a step-by-step solution to a given problemorA flowchart is a pictorial representation of an algorithm that uses boxes of different shapes to denote different types of instructions.Example2.doc:/*flowchart for comparison of two nos*/

COMPUTER PROGRAM:A computer program (also software, or just a program) is a sequence of instructions written to perform a specified task with a computer.

orA program is the expression of an algorithm in a programming language.

Instruction: An instruction is an order given to a computer processor by a computer program.

Programming language

CLASSIFICATION OF PROGRAMMING LANGUAGES

Computer programming language can be classified into two major categories:

•Low Level•High Level

DEVELOPMENT OF PROGRAMMING LANGUAGE:

Machine languageAssemble languageProcedural programming languageObject Oriented programming language

HISTORY OF C

* First C developed on UNIX operating system and it was coded in low level language in 1969.(PDP-7 assembly language).* After that "Martin Richard" developed BCPL language. BCPL is in assembly language and error prone.* Thereafter B language is developed by "Ken Thomson". B is a high Level language and it has typical functionality.* Thereafter based on B language finally C language is developed in 1972 by "Dennis MacAlistair Ritchie". And C is a middle level language.The current C programming language standard ISO/IEC 9899 was adopted by ISO and IEC in 1999. Technical corrigenda TC1, TC2, and TC3 were approved, TC2 in 2004, TC3 in 2007. ISO - International Organization for Standardization

IEC - International Electro technical Commission

CHARACTERISTICS OF C

* Small size * Extensive use of function calls * Loose typing * Structured programming * Low level (BitWise) programming readily available * Pointer implementation - extensive use of pointers for memory, array, structures and functions.

ADVANTAGES AND DISADVANTAGES OF C

Advantages of C:Efficient - C language is very efficient due to built functions.Fast - Due to conditional statements and control statements.Structured and Module ProgrammingPortability - C program written for one computer can run in other computer (with different Operating systems) with some modifications or some modifications.

Disadvantages of C:Poor error detectionIt has no commands for basic input-output operation.

RULES FOR WRITING C PROGRAM:

· C is a case sensitive language· All keyword are lower cased.· use comments to increase the readability and help to understand the program logic.· Use /**/ for multi line comments or // for a single line.· Keywords cannot be used for any other purpose ,that is they can not be used as a variable or function name.· main () is always the first function called when a program execution begins.

STRUCTURE OF C LANGUAGE PROGRAM

1. Documetation Section [optional] /*------------*/2. Link Section #include<filename>3. Definition of constants [optional] #define variable value4. Global variable declaration [optional] data type variable5. main() { declaration; executable statements; }6. Sub functionsEXAMPLE: PROGRAM1:

EXECUTING A C PROGRAM (Creating source file, Compiling, Linking)

Creating source file : 1. Using Notepad 2. Using TurboC 3. Using Dev IDEThe C Compilation :

Translation of the statements into machine language, setting up the addresses of all variables. 1.Using TurboC(Dos Based Compiler)2.Using GNC C (UNIX Based Compiler)3.Using Dev IDE(Integrated development environment)

Linking:

Linking the program with functions that are needed from the C library

Ways You can Learn Programming Faster

=>don't go too fast; get it right before moving on.=>Look at the Example Code=>Don't Just Read Example Code--Run It=>Write your Own Code as Soon as Possible=>Learn to Use a Debugger=>Seek out More Sources