CSWD1001
Programming Methods
Introduction To Computers And Programming Language
118/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
What we’ll Learn
• Understanding Computer Systems
• Simple programming logic
• Program development cycle
• Pseudocode statement and flowchart
• Evolution of programming models
218/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
What is Computer Systems???
318/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Computer System Definition
A combination of all the components
(hardware and software)
required to process and store data using a
computer.
418/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Example
518/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Hardware
• The equipment, or
the physical devices,
associated with a
computer.
Software
• Computer
instructions that tell
the hardware what to
do
• Software is
programs:
instructions written
by programmers
618/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Three Major Operations
in
Most Systems
718/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
8
Input Process Output
Storage
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Example
918/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Example
1018/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
How you give computer a instructions ??
11
or
How can humans “talk to” (instruct)
Computer??
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
1218/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
By using
a
Computer Programming Language
1318/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
14
Computer
Languages
Low Level Language
(Machine Language)
Middle Level
Language
(Assembly Language)
High Level Language
Use 1’ s & 0’ to create instructions
Ex: binary language
Use mnemonics to create instructions Similar to human language
Ex: Cobol, Fortran, Basic C, C++,
Java
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
1518/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
1618/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Program Instructions are
Stored in
Computer Memory
• It must be translated from your programming language
statements to machine language
• A compiler or an interpreter, translate the program code into
machine language
• Machine language, also called binary language, is represented
as a series of 0s and 1s
1718/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
1818/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
For a Program to Work Properly
19
You Must ????
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
You Must
 Give the instructions to the computer in a specific
sequence
Not leave any instructions out, and
 Not add extra instructions
2018/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
What you have to do
21
is to
develop the logic of the computer program
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Example
2218/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
When programmers plan the logic for a
solution to a programming
23
Pseudocode & Flowchart
they use ??
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Pseudocode
is an
English-like representation of the
logical steps
2418/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Example of Pseudocode
2518/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Flowchart
is a
Pictorial representation of the
same thing
2618/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Example of Flowchart
27
Sales >
50000
Sales >
50000
Display “Enter
the number of
hours worked.”
Display “Enter
the number of
hours worked.”
Display “Enter
the number of
hours worked.”
Display “Enter
the number of
hours worked.”
Display “Enter
the number of
hours worked.”
Return
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
A programmer’s job involves
writing instructions
but
a professional programmer usually
does not just sit down at a
computer keyboard and start typing.
2818/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
So , what they do???
2918/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
A programmer’s Job Involves
30
• Understanding the problem, planning the logic,
• Coding the program,
• Translating the program into machine language,
• Testing the program,
• Putting the program into production, and
• Maintaining it.
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
To understand Better
31
Refer Program Development Cycle
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Requirement
Gathering &
Analysis
System Analysis &
Design
(SRS & SDD)
Coding
Testing
Implementation
Maintenance
3218/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
33
Requirement
Gathering & Analysis
• Understand what the users want/needs
System Analysis &
Design
(SRS & SDD)
• Documentation of the system design & system
development
Coding
• Develop the system/program using any number of
programming language
Testing & Debugging
• Test the system work accordingly / free of error or bugs
Implementation
• Go live and ready to deploy in the organization
Maintenance
• Maintain the software in good form
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
34
How programmer write their program
Text Editor &/ Integrated development
environment (IDE)
Use what ??
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
A text editor program
that you use to create
simple text files
3518/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
IDE
is a software
package that
provides an editor,
compiler, and other
programming tools
3618/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Evolution
of Programming Models
37
People have been writing modern computer
programs since the 1940s
Currently, two major models or paradigms are
used by programmers to develop programs and
their procedures
18/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Two Major Models
• Procedural programming
• Focus on the procedures that programmers create.
• Object-oriented programming
• Focuses on objects, or “things,” and describes their features (or attributes) and
their behaviors.
3818/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
3918/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)
Summary
• Together, computer hardware (physical devices) and software (instructions)
accomplish three major operations: input, processing, and output.
• For a program to work properly, you must develop correct logic.
• A programmer’s job involves understanding the problem, planning the logic,
coding the program, translating the program into machine language, testing the
program, putting the program into production, and maintaining it.
• Programmers plan the logic for a solution to a programming problem, they often
use flowcharts or pseudocode
• You can type a program into a plain text editor or in a integrated development
(IDE) environment.
4018/9/2018
CSWD1001 @ Kwan Lee First City Unversity Malaysia
(FCUC)

1 Introduction to Computers and Programming Language

  • 1.
    CSWD1001 Programming Methods Introduction ToComputers And Programming Language 118/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 2.
    What we’ll Learn •Understanding Computer Systems • Simple programming logic • Program development cycle • Pseudocode statement and flowchart • Evolution of programming models 218/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 3.
    What is ComputerSystems??? 318/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 4.
    Computer System Definition Acombination of all the components (hardware and software) required to process and store data using a computer. 418/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 5.
    Example 518/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 6.
    Hardware • The equipment,or the physical devices, associated with a computer. Software • Computer instructions that tell the hardware what to do • Software is programs: instructions written by programmers 618/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 7.
    Three Major Operations in MostSystems 718/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 8.
    8 Input Process Output Storage 18/9/2018 CSWD1001@ Kwan Lee First City Unversity Malaysia (FCUC)
  • 9.
    Example 918/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 10.
    Example 1018/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 11.
    How you givecomputer a instructions ?? 11 or How can humans “talk to” (instruct) Computer?? 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 12.
    1218/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 13.
    By using a Computer ProgrammingLanguage 1318/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 14.
    14 Computer Languages Low Level Language (MachineLanguage) Middle Level Language (Assembly Language) High Level Language Use 1’ s & 0’ to create instructions Ex: binary language Use mnemonics to create instructions Similar to human language Ex: Cobol, Fortran, Basic C, C++, Java 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 15.
    1518/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 16.
    1618/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 17.
    Program Instructions are Storedin Computer Memory • It must be translated from your programming language statements to machine language • A compiler or an interpreter, translate the program code into machine language • Machine language, also called binary language, is represented as a series of 0s and 1s 1718/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 18.
    1818/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 19.
    For a Programto Work Properly 19 You Must ???? 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 20.
    You Must  Givethe instructions to the computer in a specific sequence Not leave any instructions out, and  Not add extra instructions 2018/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 21.
    What you haveto do 21 is to develop the logic of the computer program 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 22.
    Example 2218/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 23.
    When programmers planthe logic for a solution to a programming 23 Pseudocode & Flowchart they use ?? 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 24.
    Pseudocode is an English-like representationof the logical steps 2418/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 25.
    Example of Pseudocode 2518/9/2018 CSWD1001@ Kwan Lee First City Unversity Malaysia (FCUC)
  • 26.
    Flowchart is a Pictorial representationof the same thing 2618/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 27.
    Example of Flowchart 27 Sales> 50000 Sales > 50000 Display “Enter the number of hours worked.” Display “Enter the number of hours worked.” Display “Enter the number of hours worked.” Display “Enter the number of hours worked.” Display “Enter the number of hours worked.” Return 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 28.
    A programmer’s jobinvolves writing instructions but a professional programmer usually does not just sit down at a computer keyboard and start typing. 2818/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 29.
    So , whatthey do??? 2918/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 30.
    A programmer’s JobInvolves 30 • Understanding the problem, planning the logic, • Coding the program, • Translating the program into machine language, • Testing the program, • Putting the program into production, and • Maintaining it. 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 31.
    To understand Better 31 ReferProgram Development Cycle 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 32.
    Requirement Gathering & Analysis System Analysis& Design (SRS & SDD) Coding Testing Implementation Maintenance 3218/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 33.
    33 Requirement Gathering & Analysis •Understand what the users want/needs System Analysis & Design (SRS & SDD) • Documentation of the system design & system development Coding • Develop the system/program using any number of programming language Testing & Debugging • Test the system work accordingly / free of error or bugs Implementation • Go live and ready to deploy in the organization Maintenance • Maintain the software in good form 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 34.
    34 How programmer writetheir program Text Editor &/ Integrated development environment (IDE) Use what ?? 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 35.
    A text editorprogram that you use to create simple text files 3518/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 36.
    IDE is a software packagethat provides an editor, compiler, and other programming tools 3618/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 37.
    Evolution of Programming Models 37 Peoplehave been writing modern computer programs since the 1940s Currently, two major models or paradigms are used by programmers to develop programs and their procedures 18/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 38.
    Two Major Models •Procedural programming • Focus on the procedures that programmers create. • Object-oriented programming • Focuses on objects, or “things,” and describes their features (or attributes) and their behaviors. 3818/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)
  • 39.
    3918/9/2018 CSWD1001 @ KwanLee First City Unversity Malaysia (FCUC)
  • 40.
    Summary • Together, computerhardware (physical devices) and software (instructions) accomplish three major operations: input, processing, and output. • For a program to work properly, you must develop correct logic. • A programmer’s job involves understanding the problem, planning the logic, coding the program, translating the program into machine language, testing the program, putting the program into production, and maintaining it. • Programmers plan the logic for a solution to a programming problem, they often use flowcharts or pseudocode • You can type a program into a plain text editor or in a integrated development (IDE) environment. 4018/9/2018 CSWD1001 @ Kwan Lee First City Unversity Malaysia (FCUC)

Editor's Notes

  • #9 Input – Data enter into a computer via one or more input devices Process – processor works on the data according to the commands provided in the input stage Output – The computer shows the processed result on the output devices specified in the input stage Source - http://www.unemeuf.com/23-images-of-engineering-input-output-process-template-download_2318/
  • #11 Source https://www.slideshare.net/corb201/computer-systems-input-process-output
  • #15 You write computer instructions in a computer programming language – Visual Basic, C#, C++, or Java. Every programming language has rules governing its word usage and punctuation - the language’s syntax 1) FIRST GENERATION LANGUAGES 1GLs (Machine language) 2) SECOND GENERATION LANGAUAGES 2GLs (Assembly Language) 3) THIRD GENERATION LANGUAGES (3GLs ) (High Level Languages) 4) FOURTH GENERATION LANGUAGES (4GLs) Source https://www.quora.com/What-was-your-first-computer-language
  • #21 A program with syntax errors cannot execute. A program with no syntax errors can execute, but might contain logical errors, and produce incorrect output as a result
  • #25 Pseudo means “false,” and to code a program means to put it in a programming language; pseudo + code ! “false code,”
  • #30 Img source http://theartechcircle.com/wp-content/uploads/2014/12/HiRes2-300x300.jpg
  • #34 Understanding the problem: Programmers must first understand what the users want/needs Write programs to satisfy the needs of others/users/end users When planning a program, think of the output first. Then plan what to input and process to achieve it. System Analysis & Design (SRS & SDD) Develop the logic Documentation are provided to help the programmer understand how the software flow, Tools: flowchart, pseudocode, use case, Coding the program After the logic is developed, only then can the programmer write the program. The logic developed to solve a programming problem can be executed using any number of languages Testing & debugging A program that is free of syntax errors is not necessarily free of logical errors. A logical error - use a syntactically correct statement but incorrect within for the current context. Test the system work accordingly/ free of error or bugs If there have error/bug occur -> solve it Implementation Once the program is tested adequately, it is ready for the organization to use Maintenance Maintain the software in good form *enhancement for future uppgration
  • #36 Figure A C# number-doubling program in Notepad
  • #37 Figure A C# number-doubling program in Visual Studio
  • #39 A programming paradigm is a model of programming based on distinct concepts that shapes the way programmers design, organize and write programs Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.