KEMBAR78
Computer_Programming_Fundamentals in cpp | PPTX
Foundation of Computer Programming
By
Vivien NIYOMUGENGA
C Programming Language
auca.cprog@gmail.com
auca@2016
 Introduction
 Hardware and Software
 How Computers Store Data
 C Programming Overview
Foundation of Computer Programming
Lesson contents
 Think about some of the different ways that people use computers. In school,
students use computers for tasks such as writing papers, searching for articles,
sending email, and participating in online classes.
 At work, people use computers to analyze data, make presentations, conduct
business transactions, communicate with customers and coworkers, control
machines in manufacturing facilities, and do many other things.
 At home, people use computers for tasks such as paying bills, shopping online,
communicating with friends and family, and playing computer games.
 And don’t forget that cell phones, iPods®, BlackBerries®, car navigation systems,
and many other devices are computers too.
 The uses of computers are almost unlimited in our everyday lives.
 A computer is general purpose electronic device.
Introduction
What is a Computer?
 Computers can do a wide variety of things because they can be
programmed. This means that computers are not designed to do just one
job, but to do any job that their programs tell them to do.
 Programming is the art of writing computer programs
 At its core, computer programming is solving problems
 To solve a problem using a computer, you must express the solution to the
problem in terms of the instructions of the particular computer.
 A computer program is just a collection of the instructions necessary to
solve a specific problem.
 The approach or method that is used to solve the problem is known as an
algorithm.
 In general a computer program is a set of instructions that a computer
follows to perform a specific task.
Introduction
What is a Programming?
 Computer Programs are commonly referred to as software. Software
is essential to a computer because it controls everything the
computer does.
 All of the software that we use to make our computers useful is
created by individuals working as programmers or software
developers.
 A programmer, or software developer, is a person with the training
and skills necessary to design, create, and test computer programs.
 Computer programming is an exciting and rewarding career. Today,
you will find programmers’ work used in business, medicine,
government, law enforcement, agriculture, academics,
entertainment, and many other fields…
Introduction
What is Software?
 The physical devices that a computer is made of are
referred to as the computer’s hardware. The
programs that run on a computer are referred to as
software.
 The term hardware refers to all of the physical
devices, or components, that a computer is made of.
A computer is not one single device, but a system of
devices that all work together. Like the different
instruments in a symphony orchestra, each device in a
computer plays its own part.
Introduction
Hardware and Software
Basic Working Principle of a Computer
DATA
INPUT
DATA
(INFORMATION)
OUTPUT
DATA
PROCESSING
 Data is the raw material for data processing. Data
consists of numbers, letters and symbols and relates
to facts, events and transactions.
 Information is data that has been processed in such a
way as to be meaningful to the person who receives
it.
Introduction
 A typical computer system consists of the following
major components:
The central processing unit (CPU)
Main memory
Secondary storage devices
Input devices
Output devices
Hardware
Typical components of a computer system
Typical components of a computer system
Hardware
 When a computer is performing the tasks that a
program tells it to do, we say that the computer is
running or executing the program. The central
processing unit, or CPU, is the part of a computer that
actually runs programs.
 The CPU is the most important component in a
computer because without it, the computer could not
run software
Hardware
Functions of the CPU
 You can think of main memory as the computer’s work
area. This is where the computer stores a program while
the program is running, as well as the data that the
program is working with.
 For example, suppose you are using a word processing
program to write an assignment for one of your classes.
While you do this, both the word processing program and
the assignment are stored in main memory.
 Main memory is commonly known as random-access
memory, or RAM. It is called this because the CPU is able
to quickly access data stored at any random location in
RAM
Hardware
Functions of the Main Memory
 Secondary storage is a type of memory that can hold data for long
periods of time, even when there is no power to the computer.
 Programs are normally stored in secondary memory and loaded into
main memory as needed. Important data, such as word processing
documents, payroll data, and inventory records, is saved to
secondary storage as well.
 The most common type of secondary storage device is the disk drive.
A disk drive stores data by magnetically encoding it onto a circular
disk.
 Most computers have a disk drive mounted inside their case. External
disk drives, which connect to one of the computer’s communication
ports, are also available. External disk drives can be used to create
backup copies of important data or to move data to another
computer.
Hardware
Functions of the Secondary Storage Devices
 Input is any data the computer collects from people
and from other devices. The component that collects
the data and sends it to the computer is called an input
device.
 Common input devices are the keyboard, mouse,
scanner, microphone, and digital camera.
 Disk drives and optical drives can also be considered
input devices because programs and data are
retrieved from them and loaded into the computer’s
memory.
Functions of Input Devices
Hardware
 Output is any data the computer produces for people
or for other devices. It might be a sales report, a list of
names, or a graphic image.
 The data is sent to an output device, which formats
and presents it. Common output devices are video
displays and printers.
 Disk drives and CD recorders can also be considered
output devices because the system sends data to
them in order to be saved.
Hardware
Functions of Output Devices
Types of software
Software
Relationship between system software and
application software
Software
 The programs that control and manage the basic
operations of a computer are generally referred to as
system software.
 System software typically includes the following types of
programs:
 Operating System: Windows XP/7/8/10/server 2012, Mac OS X, and Linux.
 Utility Programs: virus scanners, file compression programs, and data
backup programs.
 Software Development Tools are the programs that programmers use to
create, modify, and test software. Assemblers, compilers, and
interpreters are examples of programs that fall into this category.
System Software
Software
 Programs that make a computer useful for everyday
tasks are known as application software. These are
the programs that people normally spend most of
their time running on their computers.
 Commonly used applications: Microsoft Word, a word
processing program, and Adobe Photoshop, an image editing
program.
 Some other examples of application software are spreadsheet
programs, email programs, web browsers, and game
programs.
Software
Application Software
 All data that is stored in a computer is converted to sequences of 0s
and 1s.
 A computer’s memory is divided into tiny storage locations known as
bytes. One byte is only enough memory to store a letter of the
alphabet or a small number. In order to do anything meaningful, a
computer has to have lots of bytes. Most computers today have
millions, or even billions, of bytes of memory.
 Each byte is divided into eight smaller storage locations known as
bits. The term bit stands for binary digit. Computer scientists usually
think of bits as tiny switches that can be either on or off. Bits aren’t
actual “switches,” however, at least not in the conventional sense
How Computers Store Data
Concepts
Think of a byte as eight switches
How Computers Store Data
Storing numbers
How Computers Store Data
Storing Characters
How Computers Store Data
 To write a program for a computer, we must use a
computer language. Over the years computer languages
have evolved from machine language to natural
languages.
 Computer languages evolves from lower level to high
level
Computer Languages
Computer Language Evolution
The Multiplication Program in Machine Language
Computer Languages
26
The only language understood by computer
hardware is machine language
Computer Languages
Note
The Multiplication Program in Symbolic Language
Computer Languages
28
Symbolic language uses symbols, or
mnemonics, to represent the various machine
language instructions.
Computer Languages
Note
29
Computer Languages
Note
An assembler translates an assembly language
program to a machine language program.
The Multiplication Program in C
Computer Languages
31
A compiler is a program that translates a high-
level language program into a separate
machine language program.
Computer Languages
Note
 To write a program for a computer, we must use a
computer language. Over the years computer languages
have evolved from machine language to natural
languages.
 Computer languages evolves from lower level to high
level
Computer Languages
Computer Language Evolution
 In this section, we explain the procedure for turning a
program written in C into machine language. The
process is presented in a straightforward, linear fashion,
but you should recognize that these steps are repeated
many times during development to correct errors and
make improvements to the code.
 Steps
 Writing and Editing a C Program
 Compiling and Linking a Program
 Executing Program
C Programming Language overview
Creating and Running a C Program
Building a C Program
C Programming Language overview

Computer_Programming_Fundamentals in cpp

  • 1.
    Foundation of ComputerProgramming By Vivien NIYOMUGENGA C Programming Language
  • 2.
  • 3.
     Introduction  Hardwareand Software  How Computers Store Data  C Programming Overview Foundation of Computer Programming Lesson contents
  • 4.
     Think aboutsome of the different ways that people use computers. In school, students use computers for tasks such as writing papers, searching for articles, sending email, and participating in online classes.  At work, people use computers to analyze data, make presentations, conduct business transactions, communicate with customers and coworkers, control machines in manufacturing facilities, and do many other things.  At home, people use computers for tasks such as paying bills, shopping online, communicating with friends and family, and playing computer games.  And don’t forget that cell phones, iPods®, BlackBerries®, car navigation systems, and many other devices are computers too.  The uses of computers are almost unlimited in our everyday lives.  A computer is general purpose electronic device. Introduction What is a Computer?
  • 5.
     Computers cando a wide variety of things because they can be programmed. This means that computers are not designed to do just one job, but to do any job that their programs tell them to do.  Programming is the art of writing computer programs  At its core, computer programming is solving problems  To solve a problem using a computer, you must express the solution to the problem in terms of the instructions of the particular computer.  A computer program is just a collection of the instructions necessary to solve a specific problem.  The approach or method that is used to solve the problem is known as an algorithm.  In general a computer program is a set of instructions that a computer follows to perform a specific task. Introduction What is a Programming?
  • 6.
     Computer Programsare commonly referred to as software. Software is essential to a computer because it controls everything the computer does.  All of the software that we use to make our computers useful is created by individuals working as programmers or software developers.  A programmer, or software developer, is a person with the training and skills necessary to design, create, and test computer programs.  Computer programming is an exciting and rewarding career. Today, you will find programmers’ work used in business, medicine, government, law enforcement, agriculture, academics, entertainment, and many other fields… Introduction What is Software?
  • 7.
     The physicaldevices that a computer is made of are referred to as the computer’s hardware. The programs that run on a computer are referred to as software.  The term hardware refers to all of the physical devices, or components, that a computer is made of. A computer is not one single device, but a system of devices that all work together. Like the different instruments in a symphony orchestra, each device in a computer plays its own part. Introduction Hardware and Software
  • 8.
    Basic Working Principleof a Computer DATA INPUT DATA (INFORMATION) OUTPUT DATA PROCESSING  Data is the raw material for data processing. Data consists of numbers, letters and symbols and relates to facts, events and transactions.  Information is data that has been processed in such a way as to be meaningful to the person who receives it. Introduction
  • 9.
     A typicalcomputer system consists of the following major components: The central processing unit (CPU) Main memory Secondary storage devices Input devices Output devices Hardware Typical components of a computer system
  • 10.
    Typical components ofa computer system Hardware
  • 11.
     When acomputer is performing the tasks that a program tells it to do, we say that the computer is running or executing the program. The central processing unit, or CPU, is the part of a computer that actually runs programs.  The CPU is the most important component in a computer because without it, the computer could not run software Hardware Functions of the CPU
  • 12.
     You canthink of main memory as the computer’s work area. This is where the computer stores a program while the program is running, as well as the data that the program is working with.  For example, suppose you are using a word processing program to write an assignment for one of your classes. While you do this, both the word processing program and the assignment are stored in main memory.  Main memory is commonly known as random-access memory, or RAM. It is called this because the CPU is able to quickly access data stored at any random location in RAM Hardware Functions of the Main Memory
  • 13.
     Secondary storageis a type of memory that can hold data for long periods of time, even when there is no power to the computer.  Programs are normally stored in secondary memory and loaded into main memory as needed. Important data, such as word processing documents, payroll data, and inventory records, is saved to secondary storage as well.  The most common type of secondary storage device is the disk drive. A disk drive stores data by magnetically encoding it onto a circular disk.  Most computers have a disk drive mounted inside their case. External disk drives, which connect to one of the computer’s communication ports, are also available. External disk drives can be used to create backup copies of important data or to move data to another computer. Hardware Functions of the Secondary Storage Devices
  • 14.
     Input isany data the computer collects from people and from other devices. The component that collects the data and sends it to the computer is called an input device.  Common input devices are the keyboard, mouse, scanner, microphone, and digital camera.  Disk drives and optical drives can also be considered input devices because programs and data are retrieved from them and loaded into the computer’s memory. Functions of Input Devices Hardware
  • 15.
     Output isany data the computer produces for people or for other devices. It might be a sales report, a list of names, or a graphic image.  The data is sent to an output device, which formats and presents it. Common output devices are video displays and printers.  Disk drives and CD recorders can also be considered output devices because the system sends data to them in order to be saved. Hardware Functions of Output Devices
  • 16.
  • 17.
    Relationship between systemsoftware and application software Software
  • 18.
     The programsthat control and manage the basic operations of a computer are generally referred to as system software.  System software typically includes the following types of programs:  Operating System: Windows XP/7/8/10/server 2012, Mac OS X, and Linux.  Utility Programs: virus scanners, file compression programs, and data backup programs.  Software Development Tools are the programs that programmers use to create, modify, and test software. Assemblers, compilers, and interpreters are examples of programs that fall into this category. System Software Software
  • 19.
     Programs thatmake a computer useful for everyday tasks are known as application software. These are the programs that people normally spend most of their time running on their computers.  Commonly used applications: Microsoft Word, a word processing program, and Adobe Photoshop, an image editing program.  Some other examples of application software are spreadsheet programs, email programs, web browsers, and game programs. Software Application Software
  • 20.
     All datathat is stored in a computer is converted to sequences of 0s and 1s.  A computer’s memory is divided into tiny storage locations known as bytes. One byte is only enough memory to store a letter of the alphabet or a small number. In order to do anything meaningful, a computer has to have lots of bytes. Most computers today have millions, or even billions, of bytes of memory.  Each byte is divided into eight smaller storage locations known as bits. The term bit stands for binary digit. Computer scientists usually think of bits as tiny switches that can be either on or off. Bits aren’t actual “switches,” however, at least not in the conventional sense How Computers Store Data Concepts
  • 21.
    Think of abyte as eight switches How Computers Store Data
  • 22.
  • 23.
  • 24.
     To writea program for a computer, we must use a computer language. Over the years computer languages have evolved from machine language to natural languages.  Computer languages evolves from lower level to high level Computer Languages Computer Language Evolution
  • 25.
    The Multiplication Programin Machine Language Computer Languages
  • 26.
    26 The only languageunderstood by computer hardware is machine language Computer Languages Note
  • 27.
    The Multiplication Programin Symbolic Language Computer Languages
  • 28.
    28 Symbolic language usessymbols, or mnemonics, to represent the various machine language instructions. Computer Languages Note
  • 29.
    29 Computer Languages Note An assemblertranslates an assembly language program to a machine language program.
  • 30.
    The Multiplication Programin C Computer Languages
  • 31.
    31 A compiler isa program that translates a high- level language program into a separate machine language program. Computer Languages Note
  • 32.
     To writea program for a computer, we must use a computer language. Over the years computer languages have evolved from machine language to natural languages.  Computer languages evolves from lower level to high level Computer Languages Computer Language Evolution
  • 33.
     In thissection, we explain the procedure for turning a program written in C into machine language. The process is presented in a straightforward, linear fashion, but you should recognize that these steps are repeated many times during development to correct errors and make improvements to the code.  Steps  Writing and Editing a C Program  Compiling and Linking a Program  Executing Program C Programming Language overview Creating and Running a C Program
  • 34.
    Building a CProgram C Programming Language overview

Editor's Notes

  • #25  ----- Meeting Notes (3/1/17 20:25) ----- Where we stopped on wednesday