KEMBAR78
Lecture1.Introduction to Computer programming.pptx
Programming
for Problem
Solving(PPS)
A problem statement is a concise statement that summarizes the current state (problem), the
ideal state (goal), and the gap between them.
• A computer is a tool that can be used to implement a plan for solving
a problem.
• A computer program is a set of instructions for a computer. These
instructions describe the steps that the computer must follow to
implement a plan.
• An algorithm is a plan for solving a problem.
• A person must design an algorithm.
• A person must translate an algorithm into a computer program.
• An algorithm is a plan for solving a problem.
The development of an algorithm (a plan) is a key step in solving a
problem. Once we have an algorithm, we can translate it into a
computer program in some programming language. Our algorithm
development process consists of five major steps.
• Step 1: Obtain a description of the problem.
• Step 2: Analyze the problem.
• Step 3: Develop a high-level algorithm.
• Step 4: Refine the algorithm by adding more detail.
• Step 5: Review the algorithm.
A problem statement is a concise statement that summarizes the current state (problem), the
ideal state (goal), and the gap between them.
• A computer is a tool that can be used to implement a plan for solving
a problem.
• A computer program is a set of instructions for a computer. These
instructions describe the steps that the computer must follow to
implement a plan.
• An algorithm is a plan for solving a problem.
• A person must design an algorithm.
• A person must translate an algorithm into a computer program.
• An algorithm is a plan for solving a problem.
The development of an algorithm (a plan) is a key step in solving a
problem. Once we have an algorithm, we can translate it into a
computer program in some programming language. Our algorithm
development process consists of five major steps.
• Step 1: Obtain a description of the problem.
• Step 2: Analyze the problem.
• Step 3: Develop a high-level algorithm.
• Step 4: Refine the algorithm by adding more detail.
• Step 5: Review the algorithm.
What Is
Programming?
• Programming is using a language that a machine can
understand in order to get it to perform various tasks.
Computer programming is how we communicate with
machines in a way that makes them function how we
need
What Is a Program?
• A program is a group of logical, mathematical and sequential functions
grouped together. When they are grouped, these functions perform a task.
Each programming language focuses on different types of tasks as well as
gives commands to the machine in different ways.
Why do we need programming language?
Programing language enables us to write efficient programs and develop
online solutions such as- mobile applications, web applications, and games,
etc.
• Programming is used to automate, maintain, assemble, measure and
interpret the processing of the data and information. It helps in accelerating
the input and output of the devices or applications.
High Level and Low Level Language
Low-level language
• The low-level language is a programming language that provides no
abstraction from the hardware, and it is represented in 0 or 1 forms,
which are the machine instructions.
Machine-level language
• The machine-level language is a language that consists of a set of
instructions that are in the binary form 0 or 1.
• As we know that computers can understand only machine
instructions, which are in binary digits, i.e., 0 and 1, so the
instructions given to the computer can be only in binary codes.
• Creating a program in a machine-level language is a very difficult
task as it is not easy for the programmers to write the program in
machine instructions. It is error-prone as it is not easy to
understand, and its maintenance is also very high.
• A machine-level language is not portable as each computer has its
machine instructions, so if we write a program in one computer
will no longer be valid in another computer.
• The different processor architectures use different machine codes.
• A compiler is required to translate a high-level language
into a low-level language.
• Advantages of a high-level language
• The high-level language is easy to read, write, and
maintain as it is written in English like words.
• The high-level languages are designed to overcome the
limitation of low-level language, i.e., portability. The
high-level language is portable; i.e., these languages
are machine-independent.
ASCII Code:
• ASCII, stands for American Standard Code for Information
Interchange. It's a 7-bit character code where every single bit
represents a unique character
History of C Language
• History of C language is interesting
to know. Here we are going to discuss
a brief history of the c language.
• C programming language was
developed in 1972 by Dennis Ritchie at
bell laboratories of AT&T (American
Telephone & Telegraph), located in the
U.S.A.
• Dennis Ritchie is known as
the founder of the c language.
• It was developed to overcome the problems of previous languages such as B,
BCPL, etc.
• Initially, C language was developed to be used in UNIX operating system. It
inherits many features of previous languages such as B and BCPL.
• To assure that the C language remains standard, in 1983, American National
Standards Institute (ANSI) appointed a technical committee to define a standard for
C. The committee approved a version of C in December 1989 which is now known as
ANSI C
Importance of C
(a) C forms the basics of programming skill. C++, C# or Java make use of a principle called Object Oriented Programming (OOP) to organize the
program. This organizing
principle has lots of advantages to offer. But even while using this organizing principle you would still need a good hold over the language elements of C
and the basic programming skills.
So it makes more sense to first learn C and then migrate to C++, C# and Java.
(b) Major parts of popular operating systems like Windows, UNIX, Linux and Android are written in C. This is because even today when it comes to
performance (speed of execution) nothing beats C. Moreover, if one is to extend the operating system to work with new devices one needs to write device
driver programs. These programs are exclusively written in C.
(c)Used in Electronic appliances. Mobile devices like Smartphones and Tablets have become rage of today. Also, common consumer devices like
microwave ovens, washing machines and digital cameras are getting smarter by the day. This smartness comes from a microprocessor, an operating system
and a program embedded in these devices.
These programs not only have to run fast but also have to work in limited amount of memory. No wonder that such programs are written in C. With these
constraints on time and space, C is the language of choice while building such operating systems and programs.
(d) Programming fast and interactive games: You must have seen several
professional 3D computer games where the user navigates some object, like say a
spaceship and fires bullets at the invaders. The essence of all such games is speed.
(e) Close interaction with hardware devices. At times one is required to very
closely interact with the hardware
devices. Since C provides several language elements that make this
interaction feasible without compromising the performance, it is
the preferred choice of the programmer.
Features
Learning C language
Lecture1.Introduction to Computer programming.pptx
Lecture1.Introduction to Computer programming.pptx
Lecture1.Introduction to Computer programming.pptx

Lecture1.Introduction to Computer programming.pptx

  • 1.
  • 4.
    A problem statementis a concise statement that summarizes the current state (problem), the ideal state (goal), and the gap between them.
  • 5.
    • A computeris a tool that can be used to implement a plan for solving a problem. • A computer program is a set of instructions for a computer. These instructions describe the steps that the computer must follow to implement a plan. • An algorithm is a plan for solving a problem. • A person must design an algorithm. • A person must translate an algorithm into a computer program.
  • 6.
    • An algorithmis a plan for solving a problem.
  • 14.
    The development ofan algorithm (a plan) is a key step in solving a problem. Once we have an algorithm, we can translate it into a computer program in some programming language. Our algorithm development process consists of five major steps. • Step 1: Obtain a description of the problem. • Step 2: Analyze the problem. • Step 3: Develop a high-level algorithm. • Step 4: Refine the algorithm by adding more detail. • Step 5: Review the algorithm.
  • 16.
    A problem statementis a concise statement that summarizes the current state (problem), the ideal state (goal), and the gap between them.
  • 17.
    • A computeris a tool that can be used to implement a plan for solving a problem. • A computer program is a set of instructions for a computer. These instructions describe the steps that the computer must follow to implement a plan. • An algorithm is a plan for solving a problem. • A person must design an algorithm. • A person must translate an algorithm into a computer program.
  • 18.
    • An algorithmis a plan for solving a problem.
  • 26.
    The development ofan algorithm (a plan) is a key step in solving a problem. Once we have an algorithm, we can translate it into a computer program in some programming language. Our algorithm development process consists of five major steps. • Step 1: Obtain a description of the problem. • Step 2: Analyze the problem. • Step 3: Develop a high-level algorithm. • Step 4: Refine the algorithm by adding more detail. • Step 5: Review the algorithm.
  • 27.
    What Is Programming? • Programmingis using a language that a machine can understand in order to get it to perform various tasks. Computer programming is how we communicate with machines in a way that makes them function how we need
  • 28.
    What Is aProgram? • A program is a group of logical, mathematical and sequential functions grouped together. When they are grouped, these functions perform a task. Each programming language focuses on different types of tasks as well as gives commands to the machine in different ways.
  • 29.
    Why do weneed programming language? Programing language enables us to write efficient programs and develop online solutions such as- mobile applications, web applications, and games, etc. • Programming is used to automate, maintain, assemble, measure and interpret the processing of the data and information. It helps in accelerating the input and output of the devices or applications.
  • 30.
    High Level andLow Level Language Low-level language • The low-level language is a programming language that provides no abstraction from the hardware, and it is represented in 0 or 1 forms, which are the machine instructions.
  • 31.
    Machine-level language • Themachine-level language is a language that consists of a set of instructions that are in the binary form 0 or 1. • As we know that computers can understand only machine instructions, which are in binary digits, i.e., 0 and 1, so the instructions given to the computer can be only in binary codes. • Creating a program in a machine-level language is a very difficult task as it is not easy for the programmers to write the program in machine instructions. It is error-prone as it is not easy to understand, and its maintenance is also very high. • A machine-level language is not portable as each computer has its machine instructions, so if we write a program in one computer will no longer be valid in another computer. • The different processor architectures use different machine codes.
  • 32.
    • A compileris required to translate a high-level language into a low-level language. • Advantages of a high-level language • The high-level language is easy to read, write, and maintain as it is written in English like words. • The high-level languages are designed to overcome the limitation of low-level language, i.e., portability. The high-level language is portable; i.e., these languages are machine-independent.
  • 34.
    ASCII Code: • ASCII,stands for American Standard Code for Information Interchange. It's a 7-bit character code where every single bit represents a unique character
  • 36.
    History of CLanguage • History of C language is interesting to know. Here we are going to discuss a brief history of the c language. • C programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T (American Telephone & Telegraph), located in the U.S.A. • Dennis Ritchie is known as the founder of the c language.
  • 37.
    • It wasdeveloped to overcome the problems of previous languages such as B, BCPL, etc. • Initially, C language was developed to be used in UNIX operating system. It inherits many features of previous languages such as B and BCPL. • To assure that the C language remains standard, in 1983, American National Standards Institute (ANSI) appointed a technical committee to define a standard for C. The committee approved a version of C in December 1989 which is now known as ANSI C
  • 39.
    Importance of C (a)C forms the basics of programming skill. C++, C# or Java make use of a principle called Object Oriented Programming (OOP) to organize the program. This organizing principle has lots of advantages to offer. But even while using this organizing principle you would still need a good hold over the language elements of C and the basic programming skills. So it makes more sense to first learn C and then migrate to C++, C# and Java. (b) Major parts of popular operating systems like Windows, UNIX, Linux and Android are written in C. This is because even today when it comes to performance (speed of execution) nothing beats C. Moreover, if one is to extend the operating system to work with new devices one needs to write device driver programs. These programs are exclusively written in C. (c)Used in Electronic appliances. Mobile devices like Smartphones and Tablets have become rage of today. Also, common consumer devices like microwave ovens, washing machines and digital cameras are getting smarter by the day. This smartness comes from a microprocessor, an operating system and a program embedded in these devices. These programs not only have to run fast but also have to work in limited amount of memory. No wonder that such programs are written in C. With these constraints on time and space, C is the language of choice while building such operating systems and programs.
  • 40.
    (d) Programming fastand interactive games: You must have seen several professional 3D computer games where the user navigates some object, like say a spaceship and fires bullets at the invaders. The essence of all such games is speed. (e) Close interaction with hardware devices. At times one is required to very closely interact with the hardware devices. Since C provides several language elements that make this interaction feasible without compromising the performance, it is the preferred choice of the programmer.
  • 41.
  • 42.