Computer Programming (BCT 1113)

Slides:



Advertisements
Similar presentations
An Introduction to Programming General Concepts. What is a program? A program is an algorithm expressed in a programming language. programming language.
Advertisements

CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 1.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
This set of slides is provided by the author of the textbook1 Introductory Topics l Computer Programming l Programming Life-Cycle Phases l Creating an.
Computers: Tools for an Information Age
PRE-PROGRAMMING PHASE
Introduction to Programming (in C++) Introduction Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
Your Interactive Guide to the Digital World Discovering Computers 2012.
CS102 Introduction to Computer Programming
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Chapter 1: Preliminaries. Objectives In this chapter, you will learn about: Unit analysis Exponential and scientific notations Software development Algorithms.
CSC-115 Introduction to Computer Programming
Programming Lifecycle
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 October 20, October 20, 2015October 20, 2015October 20,
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
1 Program Planning and Design Important stages before actual program is written.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Computer Languages [Computing] Computing.
Algorithms, problem solving and Introduction to C++
Introduction to Computers and C++ Programming
Algorithms, problem solving and Introduction to C++
Chapter 1: An Overview of Computers and Programming Languages
Programming Languages
Engineering Problem Solving With C An Object Based Approach
CSCI-235 Micro-Computer Applications
Computer Programming.
Chapter 1: An Overview of Computers and Programming Languages
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
An Introduction to Programming
Programming Languages and Translators
An Introduction to Visual Basic .NET and Program Design
Developing Applications
TRANSLATORS AND IDEs Key Revision Points.
Assembler, Compiler, Interpreter
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 Introduction(1.1)
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
CS105 Introduction to Computer Concepts Intro to programming
The Programming Process
Programming.
Chapter 1: An Overview of Computers and Programming Languages
Assembler, Compiler, Interpreter
Introduction to Computer Programming
and Program Development
ICT Programming Lesson 1:
ICT Gaming Lesson 2.
Tonga Institute of Higher Education IT 141: Information Systems
Chapter 1: Preliminaries
An Introduction to Programming
Tonga Institute of Higher Education IT 141: Information Systems
Computer Terms Review from what language did C++ originate?
CS105 Introduction to Computer Concepts Intro to programming
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
ICS103 Programming in C 1: Overview of Computers And Programming
Programming Logic and Design Eighth Edition
Presentation transcript:

Computer Programming (BCT 1113) Introduction To Programming Computer Programming Concept Problem Solving Flowchart Structure Programming Design Implementation Documentation Testing and Debugging

Objectives Understand Computer Programming Concept Problem Solving Design Flowchart Structure Programming Design Implementation of programming Documentation in programming Testing and Debugging programming

Why learn programming? To be a creator - Programming is like having access to the absolute best set of legos in the world in almost unlimited qualities Automate Away Daily Drudgery - Programmers are famous for being lazy--in fact, being lazy is one reason people are drawn to programming. After all, why do something routine and repetitive when you could have your computer do it for you? Improve Your Computer Literacy and Know the Answer to the "Why" Questions - People are often frustrated by technology when it fails. Although operating systems such as Windows have become much more stable, there are still many security holes exploited every day. For a non-programmer, these issues are mysteries: the machine that never makes mistakes is full of problems, and who knows why? 

How to learn programming? Look at the Example Code Don't Just Read Example Code--Run It Write your Own Code as Soon as Possible Learn to Use a Debugger Seek out More Sources

Types of programming language Procedural programming language – Fortran, BASIC Structural programming language – C, ADA, Pascal Object oriented programming language – JAVA, VB, C#

History of programming language Before 1940: The Jacquard loom, invented in 1801, used holes in punched cards to represent sewing loom arm movements in order to generate decorative patterns automatically. 1940: first recognizably modern, electrically powered computers were created 1950: 1960 – FORTRAN, LISP, COBOL 1967 – 1978: establishing fundamental paradigm – Simula, C, Prolog, The 1980s: consolidation, modules, performance – ADA, C++, Perl The 1990s: the Internet age – PYTHON, VB, JAVA, PHP, ASP

Programming Program: self-contained set of instructions used to operate a computer to produce a specific result Also called software Programming: the process of writing a program, or software

Programming Machine language programs, also called executables, consist of binary instructions Each instruction has two parts: Instruction part: the operation to be performed; also called an opcode Address part: memory address of the data to be used Each class of computer has its own particular machine language

Programming structure Algorithm: the step-by-step sequence of instructions that describe how the data is to be processed to produce the desired output Programming: the translation of the selected algorithm into a language the computer can use Pseudocode: English-like phrases used to describe the algorithm Formula: description of a mathematical equation Flowchart: diagram showing the flow of instructions in an algorithm Flowcharts use special symbols

Flowchart

Flowchart

Flowchart: example Figure 1.12 Flowchart for calculating the average of three numbers.

Pseudo code: example Read NUMBER1, NUMBER2, NUMBER3 Compute AVERAGE as ((NUMBER1+NUMBER2+NUMBER3)/3) Write (Display) AVERAGE

Implementation Write a program that could display following information #include <iostream> using namespace std; int main() { cout << “Umar"; cout << "\n123 Jalan Cempaka"; cout << "\nChukai, Kemaman"; cin.ignore(); // this line is optional, it is used // to keep the program from ending on Microsoft // systems/compilers so the user can see the output return 0; }

Process of Writing a Program Identify problems – requirements, specification Design a solution – pseudo code, flowchart Program Code - translating the design into an actual program, written in some form of programming language Compile - process of turning the program written in some programming language into the instructions made up of 0's and 1's that the computer can actually follow Debug - task of looking at the original program, identifying the mistakes, correcting the code and recompiling it

Documentation in Programming /* my second program in C++ with more comments */ #include <iostream> using namespace std; int main () { cout << "Hello World! "; // prints Hello World! cout << "I'm a C++ program"; // prints I'm a C++ program return 0; }

Testing & Debugging All written program must be tested to ensure it is correctly run and suit requirements. Debugging is the process of locating and fixing or bypassing bugs (errors) in computer program code or the engineering of a hardware device. To debug a program or hardware device is to start with a problem, isolate the source of the problem, and then fix it

Common programming mistakes Starting to write the program before fully understanding the requirements and the algorithm to be used Undeclared variables Uninitialized variables Using a single equal sign to check equality Undeclared Functions Extra Semicolons Misusing the && and || operators

REFERENCES http://www.cprogramming.com/whyprogram.html http://www.giac.org/cissp-papers/97.pdf http://www.cs.bham.ac.uk/~rxb/java/intro/2programming.html