SlideShare a Scribd company logo
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.

More Related Content

What's hot (20)

PPTX
Introduction to programming
Neeru Mittal
 
PPTX
C programming introduction
Ducat
 
PPTX
Translators(compiler assembler interpretor).
JayminSuhagiya
 
PPTX
Computer programming
Vincent Valenzuela
 
PPTX
10 lesson6
Mary Grace Uminga
 
PPTX
Programming in c
vishnu973656
 
DOC
Assembler
Suneel Dogra
 
PPT
Language translator
asmakh89
 
PDF
Introduction to Computer Programming
Prof. Erwin Globio
 
PPTX
10 lesson7
Mary Grace Uminga
 
PPTX
Introduction to C Programming
Anandhasilambarasan D
 
PPT
How to execute a C program
Leela Koneru
 
PPT
Programming
Leo Simon Anfone
 
PPTX
presentation on the topic: Introduction to the C language
GautamGupta136
 
PPT
Intro To Programming Concepts
Jussi Pohjolainen
 
PPTX
Introduction to Programming Concepts By Aamir Saleem Ansari
Tech
 
PPTX
Chapter 5
Hajar Len
 
DOC
Notacd07
Azmiah Mahmud
 
PPTX
Computer languages
Prince Arsal
 
PPTX
10 lesson8
Mary Grace Uminga
 
Introduction to programming
Neeru Mittal
 
C programming introduction
Ducat
 
Translators(compiler assembler interpretor).
JayminSuhagiya
 
Computer programming
Vincent Valenzuela
 
10 lesson6
Mary Grace Uminga
 
Programming in c
vishnu973656
 
Assembler
Suneel Dogra
 
Language translator
asmakh89
 
Introduction to Computer Programming
Prof. Erwin Globio
 
10 lesson7
Mary Grace Uminga
 
Introduction to C Programming
Anandhasilambarasan D
 
How to execute a C program
Leela Koneru
 
Programming
Leo Simon Anfone
 
presentation on the topic: Introduction to the C language
GautamGupta136
 
Intro To Programming Concepts
Jussi Pohjolainen
 
Introduction to Programming Concepts By Aamir Saleem Ansari
Tech
 
Chapter 5
Hajar Len
 
Notacd07
Azmiah Mahmud
 
Computer languages
Prince Arsal
 
10 lesson8
Mary Grace Uminga
 

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

PPTX
Mark asoi ppt
mark-asoi
 
DOCX
Training 8051Report
Kuldeep Kaushik
 
PPTX
Introduction to Programming kkkkkkkkkkkkk
kimtrm34
 
PDF
Programming in c
ankitjain851
 
DOCX
PROBLEM SOLVING
shahzadebaujiti
 
PPTX
Looping and switch cases
MeoRamos
 
DOC
Stnotes doc 5
Alok Jain
 
PPTX
Switch case and looping statement
_jenica
 
PPT
Program logic and design
Chaffey College
 
DOCX
C Unit 1 notes PREPARED BY MVB REDDY
Rajeshkumar Reddy
 
PDF
C tutorials
sujit11feb
 
PPTX
grade 10 2023.pptx
RaymartHerera
 
PDF
Introduction to computers
Learn By Watch
 
PPT
Slide 01
Dash Chan
 
DOCX
Programming
shalsmart12
 
PPTX
Programming Fundamentals lecture 2
REHAN IJAZ
 
PPTX
Computer Programming In C.pptx
chouguleamruta24
 
PPTX
Switch case looping
Cherimay Batallones
 
PPTX
Switch case and looping
patricia Hidalgo
 
DOC
BIT204 1 Software Fundamentals
James Uren
 
Mark asoi ppt
mark-asoi
 
Training 8051Report
Kuldeep Kaushik
 
Introduction to Programming kkkkkkkkkkkkk
kimtrm34
 
Programming in c
ankitjain851
 
PROBLEM SOLVING
shahzadebaujiti
 
Looping and switch cases
MeoRamos
 
Stnotes doc 5
Alok Jain
 
Switch case and looping statement
_jenica
 
Program logic and design
Chaffey College
 
C Unit 1 notes PREPARED BY MVB REDDY
Rajeshkumar Reddy
 
C tutorials
sujit11feb
 
grade 10 2023.pptx
RaymartHerera
 
Introduction to computers
Learn By Watch
 
Slide 01
Dash Chan
 
Programming
shalsmart12
 
Programming Fundamentals lecture 2
REHAN IJAZ
 
Computer Programming In C.pptx
chouguleamruta24
 
Switch case looping
Cherimay Batallones
 
Switch case and looping
patricia Hidalgo
 
BIT204 1 Software Fundamentals
James Uren
 
Ad

More from Muhammad Hammad Waseem (20)

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

Recently uploaded (20)

PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
PPTX
Difference between write and update in odoo 18
Celine George
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Horarios de distribución de agua en julio
pegazohn1978
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Controller Request and Response in Odoo18
Celine George
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
Difference between write and update in odoo 18
Celine George
 

[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.