SlideShare uma empresa Scribd logo
1 de 2
Baixar para ler offline
Steps & Approaches of Programming Intro to Programming
MUHAMMAD HAMMAD WASEEM 1
Creating and Editing a C Program:
To write the first C program, open the edit window of the Turbo C++/Borland C++ IDE (Integrated
Development Environment). This can be done by selecting File→New option from the Menu bar. A
window appears on the screen. This window has a white working area, and a cursor inside Window
represents the starting point to write a program.
Saving a C program:
After writing the C program, we should save it on the disk. This can be done by selecting
File→Save command from the menu bar or press Ctrl+K S keys together, there is a text box with Caption
Save File As type the Name of file. The editor assigns a default name NONAME00.cpp to the file, to save
a file to the specific folder/location with the File name, one has to specify the absolute path.
Compiling a C program:
The computer does not understand source program because instructions in the program are
meaningless to the microprocessor as it understands only the machine language. A program that is to
be executed must be in the form of machine language. C compiler translates the source program into an
object program with .obj extension. To invoke compiler, select Project→Compile from the menu bar or
press Alt+F9. If there is no error in the source program, the program will be translated to the object
program successfully. Otherwise, the compiler will report errors in the program.
Linking a C program:
While writing a C program, the programmer may refer to many files to accomplish various tasks
such as input/output etc. In case of c language a lot of functionality is available in the form of library
files. Such files are needed to be linked with the object file, produce by the complier, before execution
of the program.
Linking in the process in which the object file produce by the compiler is linked to many other
library files by the linker. The linker is a program that combines the object program with additional object
files may be needed for the program to execute and save the final machine language program as n
executable file on the disk. The linker combines different library files to the object file and produces an
executable file with .exe extension.
Executing a C program:
After successfully compiling and linking the program, we are now ready to execute it. For
execution the program must be loaded in memory. This is done by the loader. Loader is a program that
places executable file in memory. This is done by selecting Debug→Run from the menu bar or pressing
Ctrl+F9 key.
Steps & Approaches of Programming Intro to Programming
MUHAMMAD HAMMAD WASEEM 2
Programming Approaches:
Non-Structured Programming
Non-structured programming, which frequently working with GO TO branch points to transfer
from one part of the program to another part. Using GO TO codes, one could transfer backward, forward,
or anywhere else within the program. The problem is that the connections between parts of the program
by using GO TO commands can become quite messy.
This type of programming is difficult to understand and debug. Non-structured programming of
this nature is now viewed as an ineffective programming strategy.
To develop good software, developers have to carefully think out and design the programs. In
the earliest days of computing, programmers wrote software according to their own whims (desires),
with the result that programs were often confusing and difficult to work with. Software today is expected
to follow recognized design principles. The prevailing design standards are structured programming and
structured design.
Structured Programming
Structured programming was invented to address the shortcomings of nonstructural
programming. Structured programming makes use of the control structures (sequence, selection and
repetition). Structured programming does not use GO TO commands. The sequence principle implies
that program instructions should be executed in the order in which they appear. The selection principle
implies that instructions may be executed selectively using IF-THEN and/or IF-THEN-ELSE statements.
These statements work in the following way. IF a condition is met or is true, THEN a specific set of
instructions will be executed. If the condition is false, then another set of instructions will be executed.
For example, ______________.
Alternatively when there are many options, one can employ the CASE statement.
The iteration principle indicates that one part of the program can be repeated or iterated a
limited number of times. In most computer languages, the iteration may be activated by using REPEAT -
--UNTIL or using the WHILE loop and the FOR loop.
Modular Programming
The Modular Approach to programming involves breaking a program down into subcomponents
called modules. Each module is composed of an independent or self-contained set of instructions.
Modules are also referred to as routines, subroutines, or subprograms or procedures. Each module is
designed to perform a specific task in the overall program, such as to calculate the gross pay of an
employee in a payroll program.
The advantage of modular programming is the ability to write & test each module independently
and in some cases reuse modules in other programs. A program can consists of multiple modules. In
addition, there is a main module in the program that executes the other modules.

Mais conteúdo relacionado

Mais procurados

Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programmingNeeru Mittal
 
C programming introduction
C programming introductionC programming introduction
C programming introductionDucat
 
Translators(compiler assembler interpretor).
Translators(compiler assembler interpretor).Translators(compiler assembler interpretor).
Translators(compiler assembler interpretor).JayminSuhagiya
 
Language translator
Language translatorLanguage translator
Language translatorasmakh89
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer ProgrammingProf. Erwin Globio
 
How to execute a C program
How to execute a C  program How to execute a C  program
How to execute a C program Leela Koneru
 
presentation on the topic: Introduction to the C language
presentation on the topic: Introduction to the C languagepresentation on the topic: Introduction to the C language
presentation on the topic: Introduction to the C languageGautamGupta136
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming ConceptsJussi Pohjolainen
 
Introduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem AnsariIntroduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem AnsariTech
 
Computer languages
Computer languagesComputer languages
Computer languagesPrince Arsal
 

Mais procurados (20)

Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
C programming introduction
C programming introductionC programming introduction
C programming introduction
 
Translators(compiler assembler interpretor).
Translators(compiler assembler interpretor).Translators(compiler assembler interpretor).
Translators(compiler assembler interpretor).
 
Computer programming
Computer programmingComputer programming
Computer programming
 
10 lesson6
10 lesson610 lesson6
10 lesson6
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Assembler
AssemblerAssembler
Assembler
 
Language translator
Language translatorLanguage translator
Language translator
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
10 lesson7
10 lesson710 lesson7
10 lesson7
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
How to execute a C program
How to execute a C  program How to execute a C  program
How to execute a C program
 
Programming
ProgrammingProgramming
Programming
 
presentation on the topic: Introduction to the C language
presentation on the topic: Introduction to the C languagepresentation on the topic: Introduction to the C language
presentation on the topic: Introduction to the C language
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming Concepts
 
Introduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem AnsariIntroduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem Ansari
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Notacd07
Notacd07Notacd07
Notacd07
 
Computer languages
Computer languagesComputer languages
Computer languages
 
10 lesson8
10 lesson810 lesson8
10 lesson8
 

Semelhante a [ITP - Lecture 02] Steps to Create Program & Approaches of Programming

Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5Alok Jain
 
Overview of c++
Overview of c++Overview of c++
Overview of c++geeeeeet
 
SULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN BASHA
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfSubramanyambharathis
 
Comso c++
Comso c++Comso c++
Comso c++Mi L
 
Module 201 2 20 just 20 basic
Module 201   2  20  just 20 basic Module 201   2  20  just 20 basic
Module 201 2 20 just 20 basic Nick Racers
 
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshuunit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshuGauravRawat830030
 
Chapter 13.1.4
Chapter 13.1.4Chapter 13.1.4
Chapter 13.1.4patcha535
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compilerA. S. M. Shafi
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTBatra Centre
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming Hemantha Kulathilake
 
Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7Shipra Swati
 

Semelhante a [ITP - Lecture 02] Steps to Create Program & Approaches of Programming (20)

Programming in c
Programming in cProgramming in c
Programming in c
 
Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5
 
PROBLEM SOLVING
PROBLEM SOLVINGPROBLEM SOLVING
PROBLEM SOLVING
 
Overview of c++
Overview of c++Overview of c++
Overview of c++
 
SULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notes
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 
Comso c++
Comso c++Comso c++
Comso c++
 
Lect-01.ppt
Lect-01.pptLect-01.ppt
Lect-01.ppt
 
Module 1 2 just basic-
Module 1 2  just basic-Module 1 2  just basic-
Module 1 2 just basic-
 
Module 201 2 20 just 20 basic
Module 201   2  20  just 20 basic Module 201   2  20  just 20 basic
Module 201 2 20 just 20 basic
 
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshuunit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
unit 1 programming in c ztgdawte efhgfhj ewnfbshyufh fsfyshu
 
Chapter 13.1.4
Chapter 13.1.4Chapter 13.1.4
Chapter 13.1.4
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compiler
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
 
Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming
 
Programming in C
Programming in CProgramming in C
Programming in C
 
WEBSITE DEVELOPMENT
WEBSITE DEVELOPMENTWEBSITE DEVELOPMENT
WEBSITE DEVELOPMENT
 
Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7
 

Mais de Muhammad Hammad Waseem

[ITP - Lecture 16] Structures in C/C++
[ITP - Lecture 16] Structures in C/C++[ITP - Lecture 16] Structures in C/C++
[ITP - Lecture 16] Structures in C/C++Muhammad Hammad Waseem
 
[ITP - Lecture 13] Introduction to Pointers
[ITP - Lecture 13] Introduction to Pointers[ITP - Lecture 13] Introduction to Pointers
[ITP - Lecture 13] Introduction to PointersMuhammad Hammad Waseem
 
[ITP - Lecture 10] Switch Statement, Break and Continue Statement in C/C++
[ITP - Lecture 10] Switch Statement, Break and Continue Statement in C/C++[ITP - Lecture 10] Switch Statement, Break and Continue Statement in C/C++
[ITP - Lecture 10] Switch Statement, Break and Continue Statement in C/C++Muhammad Hammad Waseem
 
[ITP - Lecture 09] Conditional Operator in C/C++
[ITP - Lecture 09] Conditional Operator in C/C++[ITP - Lecture 09] Conditional Operator in C/C++
[ITP - Lecture 09] Conditional Operator in C/C++Muhammad Hammad Waseem
 
[ITP - Lecture 08] Decision Control Structures (If Statement)
[ITP - Lecture 08] Decision Control Structures (If Statement)[ITP - Lecture 08] Decision Control Structures (If Statement)
[ITP - Lecture 08] Decision Control Structures (If Statement)Muhammad Hammad Waseem
 
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of PrecedenceMuhammad Hammad Waseem
 
[ITP - Lecture 04] Variables and Constants in C/C++
[ITP - Lecture 04] Variables and Constants in C/C++[ITP - Lecture 04] Variables and Constants in C/C++
[ITP - Lecture 04] Variables and Constants in C/C++Muhammad Hammad Waseem
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member FunctionsMuhammad Hammad Waseem
 
[OOP - Lec 16,17] Objects as Function Parameter and ReturnType
[OOP - Lec 16,17] Objects as Function Parameter and ReturnType[OOP - Lec 16,17] Objects as Function Parameter and ReturnType
[OOP - Lec 16,17] Objects as Function Parameter and ReturnTypeMuhammad Hammad Waseem
 
[OOP - Lec 13,14,15] Constructors / Destructor and its Types
[OOP - Lec 13,14,15] Constructors / Destructor and its Types[OOP - Lec 13,14,15] Constructors / Destructor and its Types
[OOP - Lec 13,14,15] Constructors / Destructor and its TypesMuhammad Hammad Waseem
 
[OOP - Lec 09,10,11] Class Members & their Accessing
[OOP - Lec 09,10,11] Class Members & their Accessing[OOP - Lec 09,10,11] Class Members & their Accessing
[OOP - Lec 09,10,11] Class Members & their AccessingMuhammad Hammad Waseem
 

Mais de Muhammad Hammad Waseem (20)

[ITP - Lecture 17] Strings in C/C++
[ITP - Lecture 17] Strings in C/C++[ITP - Lecture 17] Strings in C/C++
[ITP - Lecture 17] Strings in C/C++
 
[ITP - Lecture 16] Structures in C/C++
[ITP - Lecture 16] Structures in C/C++[ITP - Lecture 16] Structures in C/C++
[ITP - Lecture 16] Structures in C/C++
 
[ITP - Lecture 15] Arrays & its Types
[ITP - Lecture 15] Arrays & its Types[ITP - Lecture 15] Arrays & its Types
[ITP - Lecture 15] Arrays & its Types
 
[ITP - Lecture 14] Recursion
[ITP - Lecture 14] Recursion[ITP - Lecture 14] Recursion
[ITP - Lecture 14] Recursion
 
[ITP - Lecture 13] Introduction to Pointers
[ITP - Lecture 13] Introduction to Pointers[ITP - Lecture 13] Introduction to Pointers
[ITP - Lecture 13] Introduction to Pointers
 
[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++
 
[ITP - Lecture 11] Loops in C/C++
[ITP - Lecture 11] Loops in C/C++[ITP - Lecture 11] Loops in C/C++
[ITP - Lecture 11] Loops in C/C++
 
[ITP - Lecture 10] Switch Statement, Break and Continue Statement in C/C++
[ITP - Lecture 10] Switch Statement, Break and Continue Statement in C/C++[ITP - Lecture 10] Switch Statement, Break and Continue Statement in C/C++
[ITP - Lecture 10] Switch Statement, Break and Continue Statement in C/C++
 
[ITP - Lecture 09] Conditional Operator in C/C++
[ITP - Lecture 09] Conditional Operator in C/C++[ITP - Lecture 09] Conditional Operator in C/C++
[ITP - Lecture 09] Conditional Operator in C/C++
 
[ITP - Lecture 08] Decision Control Structures (If Statement)
[ITP - Lecture 08] Decision Control Structures (If Statement)[ITP - Lecture 08] Decision Control Structures (If Statement)
[ITP - Lecture 08] Decision Control Structures (If Statement)
 
[ITP - Lecture 07] Comments in C/C++
[ITP - Lecture 07] Comments in C/C++[ITP - Lecture 07] Comments in C/C++
[ITP - Lecture 07] Comments in C/C++
 
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
 
[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes
 
[ITP - Lecture 04] Variables and Constants in C/C++
[ITP - Lecture 04] Variables and Constants in C/C++[ITP - Lecture 04] Variables and Constants in C/C++
[ITP - Lecture 04] Variables and Constants in C/C++
 
[OOP - Lec 20,21] Inheritance
[OOP - Lec 20,21] Inheritance[OOP - Lec 20,21] Inheritance
[OOP - Lec 20,21] Inheritance
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
 
[OOP - Lec 18] Static Data Member
[OOP - Lec 18] Static Data Member[OOP - Lec 18] Static Data Member
[OOP - Lec 18] Static Data Member
 
[OOP - Lec 16,17] Objects as Function Parameter and ReturnType
[OOP - Lec 16,17] Objects as Function Parameter and ReturnType[OOP - Lec 16,17] Objects as Function Parameter and ReturnType
[OOP - Lec 16,17] Objects as Function Parameter and ReturnType
 
[OOP - Lec 13,14,15] Constructors / Destructor and its Types
[OOP - Lec 13,14,15] Constructors / Destructor and its Types[OOP - Lec 13,14,15] Constructors / Destructor and its Types
[OOP - Lec 13,14,15] Constructors / Destructor and its Types
 
[OOP - Lec 09,10,11] Class Members & their Accessing
[OOP - Lec 09,10,11] Class Members & their Accessing[OOP - Lec 09,10,11] Class Members & their Accessing
[OOP - Lec 09,10,11] Class Members & their Accessing
 

Último

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 

Último (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 

[ITP - Lecture 02] Steps to Create Program & Approaches of Programming

  • 1. Steps & Approaches of Programming Intro to Programming MUHAMMAD HAMMAD WASEEM 1 Creating and Editing a C Program: To write the first C program, open the edit window of the Turbo C++/Borland C++ IDE (Integrated Development Environment). This can be done by selecting File→New option from the Menu bar. A window appears on the screen. This window has a white working area, and a cursor inside Window represents the starting point to write a program. Saving a C program: After writing the C program, we should save it on the disk. This can be done by selecting File→Save command from the menu bar or press Ctrl+K S keys together, there is a text box with Caption Save File As type the Name of file. The editor assigns a default name NONAME00.cpp to the file, to save a file to the specific folder/location with the File name, one has to specify the absolute path. Compiling a C program: The computer does not understand source program because instructions in the program are meaningless to the microprocessor as it understands only the machine language. A program that is to be executed must be in the form of machine language. C compiler translates the source program into an object program with .obj extension. To invoke compiler, select Project→Compile from the menu bar or press Alt+F9. If there is no error in the source program, the program will be translated to the object program successfully. Otherwise, the compiler will report errors in the program. Linking a C program: While writing a C program, the programmer may refer to many files to accomplish various tasks such as input/output etc. In case of c language a lot of functionality is available in the form of library files. Such files are needed to be linked with the object file, produce by the complier, before execution of the program. Linking in the process in which the object file produce by the compiler is linked to many other library files by the linker. The linker is a program that combines the object program with additional object files may be needed for the program to execute and save the final machine language program as n executable file on the disk. The linker combines different library files to the object file and produces an executable file with .exe extension. Executing a C program: After successfully compiling and linking the program, we are now ready to execute it. For execution the program must be loaded in memory. This is done by the loader. Loader is a program that places executable file in memory. This is done by selecting Debug→Run from the menu bar or pressing Ctrl+F9 key.
  • 2. Steps & Approaches of Programming Intro to Programming MUHAMMAD HAMMAD WASEEM 2 Programming Approaches: Non-Structured Programming Non-structured programming, which frequently working with GO TO branch points to transfer from one part of the program to another part. Using GO TO codes, one could transfer backward, forward, or anywhere else within the program. The problem is that the connections between parts of the program by using GO TO commands can become quite messy. This type of programming is difficult to understand and debug. Non-structured programming of this nature is now viewed as an ineffective programming strategy. To develop good software, developers have to carefully think out and design the programs. In the earliest days of computing, programmers wrote software according to their own whims (desires), with the result that programs were often confusing and difficult to work with. Software today is expected to follow recognized design principles. The prevailing design standards are structured programming and structured design. Structured Programming Structured programming was invented to address the shortcomings of nonstructural programming. Structured programming makes use of the control structures (sequence, selection and repetition). Structured programming does not use GO TO commands. The sequence principle implies that program instructions should be executed in the order in which they appear. The selection principle implies that instructions may be executed selectively using IF-THEN and/or IF-THEN-ELSE statements. These statements work in the following way. IF a condition is met or is true, THEN a specific set of instructions will be executed. If the condition is false, then another set of instructions will be executed. For example, ______________. Alternatively when there are many options, one can employ the CASE statement. The iteration principle indicates that one part of the program can be repeated or iterated a limited number of times. In most computer languages, the iteration may be activated by using REPEAT - --UNTIL or using the WHILE loop and the FOR loop. Modular Programming The Modular Approach to programming involves breaking a program down into subcomponents called modules. Each module is composed of an independent or self-contained set of instructions. Modules are also referred to as routines, subroutines, or subprograms or procedures. Each module is designed to perform a specific task in the overall program, such as to calculate the gross pay of an employee in a payroll program. The advantage of modular programming is the ability to write & test each module independently and in some cases reuse modules in other programs. A program can consists of multiple modules. In addition, there is a main module in the program that executes the other modules.