You are on page 1of 55

*

*
An organized list of instructions that,
when executed, causes the computer to behave in a
predetermined manner. Without programs,
computers are useless.
A computer program is a collection of instructions
that performs a specific task when executed by
a computer. A computer requires programs to
function, and typically executes
the program's instructions in a central processing
uni
*
Steve Jobs
Everybody in this country should learn how to program a computer, should
learn a computer language, because it teaches you how to think.
It's like going to law school. I don't think anybody should be a lawyer, but
going to law school can actually be useful because it teaches you how to
think in a certain way....I view computer science as a liberal art.
*
1. Define The Problem
2. Planning The Solution
3. Coding The Program
4. Testing The Program
5. Documenting The Program
Defining the
problem

Documentin
g the Planning the
progam solution

Testing the Coding the


program program
*
If you don’t have a clear understanding of the problem.it is impossible to
develop a solution of that problem. So defining the problem required that the
programmer specify four mini task
1. Program Objective
2. Desired output
3. Input data required
4. Processing requirement
You face the problem every day in your life and solve it . A problem might be
deciding to attend a party or changing your class in order to adjust in a better
way. So you every day determined the objective first to solve the problem.
Programmer work on the same way . So you should have to write a statement
of the problem that you are trying to solve.
It is always better to think about that how I get that output what is my
requirement for my output which I want .
What information should the output include . Users have to make sure that
what they want.
When to decided that what output you want. Now to determined input data
requirement like what type of user interface I have to use ? What is its
source?. Basically what type of input data is needed?
Now you should understand the operation which must have to perform and
who it is happening ?
What are the software requirement for the hardware resources that must be
available it the program run successfully .
*
• Plan a solution preferable using structured programming technique or
program design tools. The following techniques are
• 1)Top-Down program design
• 2)Algorithm
• 3)Flowcharts
You can use top-down program design to identify the program’s steps such
step are called program modules
Complex problems can be solved using top-down design, also known as
stepwise refinement, where
• We break the problem into parts
• Then break the parts into parts
• Soon, each of the parts will be easy to do
• Breaking the problem into parts helps us to clarify what needs to be done.
• At each step of refinement, the new parts become less complicated and,
therefore, easier to figure out.
• Parts of the solution may turn out to be reusable.
• Breaking the problem into parts allows more than one person to work on
the solution.
*
• Should any of these steps be broken down further? Possibly.
• How do I know? Ask yourself whether or not you could easily write the
algorithm for the step. If not, break it down again.
• When you are comfortable with the breakdown, write the pseudocode for
each of the steps (modules) in the hierarchy.
• Typically, each module will be coded as a separate function.
*
• We will use top-down design for all remaining programming projects.
• This is the standard way of writing programs.
• Programs produced using this method and using only the three kinds of
control structures, sequential, selection and repetition, are called
structured programs.
• Structured programs are easier to test, modify, and are also easier for
other programmers to understand.
*
* Problem: Write a program that draws this picture of a house.
*
*Draw the outline of the house
*Draw the chimney
*Draw the door
*Draw the windows
Main

Draw Draw Draw Draw


Outline Chimney Door Windows
*
A typical programming task can be divided into two
phases:

Problem solving phase


produce an ordered sequence of steps that describe
solution of problem
this sequence of steps is called an algorithm

Implementation phase
implement the program in some programming language
*
*(Dictionary) A schematic representation of a sequence of
operations, as in a manufacturing process or computer
program.

*(Technical) A graphical representation of the sequence of


operations in an information system or program.
Information system flowcharts show how data flows from
source documents through the computer to final
distribution to users. Program flowcharts show the
sequence of instructions in a single program or
subroutine. Different symbols are used to draw each type
of flowchart.
*
A Flowchart

* shows logic of an algorithm


* emphasizes individual steps and their interconnections
* e.g. control flow from one action to the next
*
C programming examples: These programs illustrate various programming
elements, concepts such as using operators, loops, functions, single and
double dimensional arrays, performing operations on strings, files, pointers
etc. Browse the code from simple c program to complicated ones you are
looking for, every one of them is provided with output. C program download
with executable files, so that you save on your computer and run programs
without compiling the source code. All programs are made using c
programming language and Code blocks, most of these will work under Dev
C++ compiler also. Download software you need to develop codes.
*
Testing program is the step in which check that program which we made it
work or not?
There is some error may be present. because of these error program is not
running ,…
There are following types of error .
1)Syntax Error
2)Logic Error
3)Runtime Error
Syntax Errors
Syntax errors are those that appear while you write code. Visual Basic checks
your code as you type it in the Code Editor window and alerts you if you make a
mistake, such as misspelling a word or using a language element improperly.
Syntax errors are the most common type of errors. You can fix them easily in the
coding environment as soon as they occur.

Run-Time Errors
Run-time errors are those that appear only after you compile and run your code.
These involve code that may appear to be correct in that it has no syntax errors,
but that will not execute. For example, you might correctly write a line of code
to open a file. But if the file is corrupted, the application cannot carry out
the Open function, and it stops running. You can fix most run-time errors by
rewriting the faulty code, and then recompiling and rerunning it.

Logic Errors
Logic errors are those that appear once the application is in use. They are most
often unwanted or unexpected results in response to user actions. For example, a
mistyped key or other outside influence might cause your application to stop
working within expected parameters, or altogether. Logic errors are generally the
hardest type to fix, since it is not always clear where they originate.
*
*
*
Debugging, in computer programming and engineering, is a multistep process that involves identifying a problem, isolating the source
of the problem, and then either correcting the problem or determining a way to work around it. The final step of debugging is to test
the correction or workaround and make sure it works.
In software development, debugging involves locating and correcting code errors in a computer program. Debugging is part of
the software testing process and is an integral part of the entire software development lifecycle. The debugging process starts as soon
as code is written and continues in successive stages as code is combined with other units of programming to form a software product.
In a large program that has thousands and thousands of lines of code, the debugging process can be made easier by using strategies
such as unit tests, code reviews and pair programming.
*
In computer hardware and software product development, documentation is
the information that describes the product to its users. It consists of the
product technical manuals and online information (including online versions
of the technical manuals and help facility descriptions). The term is also
sometimes used to mean the source information about the product contained
in design documents, detailed code comments, white papers, and blackboard
session notes
1)User Documentation
2)Operator Documentation
3)Programmers Documentation
*PROGRAMMING
LANGUAGE
*
A programming language is a set of commands, instructions, and
other syntax use to create a software program. Languages that programmers
use to write code are called "high-level languages." This code can be
compiled into a "low-level language," which is recognized directly by the
computer hardware.
Programming Language
A programming language is a type of software. A program is a set of step by step
instruction that directs the computer to do the tasks you want it to do and
produce the result you want. A set of rules that provides a way of telling a
computer when operations to perform is called a Programming Language.
Machine Language (Low Level Language)
Every creation of this universe has its own language. Like wise, computer has a
language that is called Machine Language (machine level language) for instructing
computer to perform specific task. It is also called binary language because it is
the language of 0s and 1s, means every instruction in Machine language consists of
a series of 0s and 1s (binary code) that a computer can understand and execute
directly. Each machine language statement corresponds to one machine action. An
operation that requires one machine language instruction in one computer may
require several instructions in another computer. Each computer has its own
unique machine language.
Assembly Language
In assembly language, the statements are written in symbolic codes (termed as
mnemonics) that are easier for human to read and write as compared to machine
language. Each assembly language statement corresponds to one machine language
statement.
Advantages of Assembly Language

1. Operation codes of machine language are mnemonics, which are easy to


remember.
2. An Assembly language program may be written easily as compared to machine
language.
3. The memory addresses are used in machine language which is replaced by the
variable names in this language.
4. Revision of complete program is quite easy.
5. The insertion and deletion of the instructions in the program are quite easy.

Disadvantages of Assembly Language

1. As compared to machine language assembly language is less efficient.


2. An assembly language program cannot be executed on small size computers.
High Level Language
High level languages are closer to human languages than low-level language and
include statement like GOTO and PRINT which are regular words. Unlike the
assembly language, the program of high level languages do not have to be written
for a particular computer, but it can be execute on any machine that has a
compiler for that language
*
*
1) Write a Hello World Fortran Program
2) Make sure Fortran compiler is installed on your system
3) Installing GNU Fortran compiler.
4) Compile the Fortran program
5) Execute the Fortran program (a.out)

$ vim helloworld.f

program hello
print *,"Hello World!"
end program hello
*
1) Write a Hello World Cobol Program
2) Make sure Cobol Compiler is installed on your system
3) Installing cobc compiler
4) Compile the Cobol program
5) Execute the Cobol program

$ vim helloworld

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
* simple hello world program
PROCEDURE DIVISION.
DISPLAY 'Hello world!'.
STOP RUN.
*

Basic

PRINT "Hello, world!"

Pascal

program HelloWorld;
begin
WriteLn('Hello, world!');
end.
*

#include

int main(void)
{
puts("Hello, world!");
}
*
* Object-oriented programming (OOP) is a computer programming
model that organizes software design around data, or objects,
rather than functions and logic. An object can be defined as a
data field that has unique attributes and behaveor
* Java
* JavaScript
* Python
* C++
* Visual Basic .NET
* Ruby
* Scala
* PHP
*
* Visual programming is a type of programming language that lets
humans describe processes using illustration. Whereas a typical text-
based programming language makes the programmer think like a
computer, a visual programming language lets the programmer
describe the process in terms that make sense to humans.
*OR
* A visual programming language (VPL) is a programming language that
uses graphical elements and figures to develop a program.
* A VPL employs techniques to design a software program in two or more
dimensions, and includes graphical elements, text, symbols and icons
within its programming context.
* A visual programming language is also known as an executable graphics
language.
*

You might also like