Naija Dukes 2011 Nigeria JUG, Lagos Demystifying Programming. Akintayo A. Olusegun, +trinisoftinc,

Slides:



Advertisements
Similar presentations
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Advertisements

Lecture 1: Overview of Computers & Programming
Introduction to a Programming Environment
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Chapter 3 Planning Your Solution
The Program Design Phases
1 Programming Languages Examples: C, Java, HTML, Haskell, Prolog, SAS Also known as formal languages Completely described and rigidly governed by formal.
Your Interactive Guide to the Digital World Discovering Computers 2012.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
Learning Objectives Data and Information Six Basic Operations Computer Operations Programs and Programming What is Programming? Types of Languages Levels.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Programming Concepts Chapter 3.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
1 Program Planning and Design Important stages before actual program is written.
There are only 10 different kinds of people in the world: those who know binary and those who don't. - Anonymous.
The Hashemite University Computer Engineering Department
WHAT IS THIS? Clue…it’s a drink SIMPLE SEQUENCE CONTROL STRUCTURE Introduction A computer is an extremely powerful, fast machine. In less than a second,
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
CS1428 Foundations of Computer Science I The Basics.
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.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Algorithms and Flowcharts
11 Making Decisions in a Program Session 2.3. Session Overview  Introduce the idea of an algorithm  Show how a program can make logical decisions based.
AS Level Computing 8 CHAPTER: Fundamentals of structured programming The basics of good programming Algorithms System Flow Charts Symbol Conventions Steps.
Chapter 1 Introduction 2nd Semester H
App Camp Gave written instructions for what we were doing and why.
A451 Theory – 7 Programming 7A, B - Algorithms.
INTRODUCTION TO PROBLEM SOLVING
Programming Languages
Lecture 1 Introduction Richard Gesick.
CMSC201 Computer Science I for Majors Lecture 22 – Binary (and More)
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Be A programmer in Steps
Chapter 2- Visual Basic Schneider
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
CS101 Introduction to Computing Lecture 19 Programming Languages
Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.
Lecture 2 Introduction to Programming
Algorithm Algorithm is a step-by-step procedure or formula or set of instruction for solving a problem Its written in English language or natural language.
Introduction to Computer Programming
Programming Logic n Techniques
Creating Flowcharts AIM:
Print slides for students reference
Designing and Debugging Batch and Interactive COBOL Programs
Unit# 9: Computer Program Development
Lesson 2 Programming constructs – Algorithms – Scratch – Variables Intro.
Theory of Computation Turing Machines.
Arrays 6-Dec-18.
Loops CIS 40 – Introduction to Programming in Python
Chapter 2- Visual Basic Schneider
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction(1.1)
Chapter 2- Visual Basic Schneider
Chapter One: An Introduction to Programming and Visual Basic
Programming.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Basic Concepts of Algorithm
Arrays 2-May-19.
ICS103 Programming in C 1: Overview of Computers And Programming
Programming Logic and Design Eighth Edition
Introduction to Programming
Presentation transcript:

Naija Dukes 2011 Nigeria JUG, Lagos Demystifying Programming. Akintayo A. Olusegun, +trinisoftinc, NaijaDukes

Nigeria JUG, Lagos NaijaDukes The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures. Yet the program construct, unlike the poet's words, is real in the sense that it moves and works, producing visible outputs separate from the construct itself. It prints results, draws pictures, produces sounds, moves arms. The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be.... The computer resembles the magic of legend in this respect, too. If one character, one pause, of the incantation is not strictly in proper form, the magic doesn't work. Human beings are not accustomed to being perfect, and few areas of human activity demand it. Adjusting to the requirement for perfection is, I think, the most difficult part of learning to program. Fredrick P. Brooks.

How I learnt Mathematics Nigeria JUG, Lagos NaijaDukes If the foundation be destroyed, what can the righteous do?

What Is A Computer? Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes An ELECTRONIC device that can accept data as INPUT, act on or PROCESS the data, STORE the data if necessary and produce a useful OUTPUT. ELECTRONIC: Computers operate on boolean logic INPUT: You can talk to computers PROCESS: Computer can take actions and make decisions STORE: Computers can keep information in memory to be recalled at a later date OUTPUT: Computers can talk back to you. Computer = Input + Process + Storage + Output.

What Is Computer Programming? Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes Programming (or Computer Programming) is a way to tell the computer to behave the way we say it can behave previously. i.e Input + Process + Storage + Output. In the past computer programs are written in binary, as we advance in computing, we also advance in the way we talk to the computer. Today, we can talk to the computer (programming) in very human readable forms. For a full history of computer programming see

Assemblers, Compilers and Interpreters Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes Assembly Language is the lowest level of computer programs these days and the number of assembly language programmers are on the decline. This is due in part to the terseness of the language, and also due in part to the fact that there are programming languages that are very close to human language. As an example to add two numbers, say 4 and 6 in assembly language we will write mov ax,4 mov bx,6 add ax,bx But in high level languages we will simply write So developers are adopting these high level languages more than assembly language. Also even though assembly language is low level, it still needs to be converted to machine language by what we call an assembler. One thing though is programs written in assembly language can execute noticeably faster than those written in high level languages.

Assemblers, Compilers and Interpreters Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes These days, we often refer to computer programs as source code. Source code makes sense because the programs written in the source code needs to be translated to object code or machine language. A program that does this translation is a Compiler. The job of a compiler most times is to create an executable program from the source code. But the major advantage of compilers is this: Before compilers, programs written in assembly language are machine dependent(Hardware Architecture). But with compilers, you can write your code and make it run on different machines without making changes (or much changes). Compilers take a bunch of code, analyze it and produce an executable. Interpreters however take a source code and run it line by line. If there's an error you get it at run time. Some other interpreters take a source code, convert it into an intermediate, efficient representation and runs it immediately.

Programming in Real World Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes As said earlier, every program you will ever write contains at least one of INPUT, PROCESS, STORAGE and OUTPUT. From the most trivial to the most complex. Let's take a program that just says “hello world” when it is run. This program has just one of the above four, OUTPUT. You can just write print “hello world” Now lets say you want to make this program a bit complex. What if when the program is run, you want to ask the name of the user, then prints “hello “ and the name of the user. You now have INPUT, PROCESS, OUTPUT input name print “hello “ + name The + sign is the process

Programming in Real World Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes Now lets take another example. A program that calculates the sum of two numbers and prints the output. Let's say the numbers are 4 and 6. We can have sum=4+6 print sum But lets make it a bit more complex, say when the program is run, ask the user to enter the two numbers he wants to add and display the output to him/her, we can then have input a input b sum=a+b print sum The first program have PROCESS, STORAGE and OUTPUT. The second one have INPUT, PROCESS, STORAGE and OUTPUT

Programming in Real World Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes As a final example, lets say you are a programmer for a large paleontology firm. Your major problem is calculating the age of dinosaurs from dinosaur bone samples taken from the field. You are then asked to write a computer program they can use to calculate the age of dinosaurs from bone samples because they don't want to do it manually anymore. The same concept applies. INPUT=dinosaur bone sample PROCESS=compute age of dinosaur STORAGE=save bone sample and age for future use OUTPUT=age of dinosaur You can see that we have taken a seemingly complex program, broken it down into these four categories and things are looking easier.

Programming Tools – Flow Charts Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes There are some tools that programmers use to make their job easier. One of them is flow chart. A flow chart is an diagram of some kind that represents a process showing the steps as boxes of various kinds, and their order by connecting these with arrows. This diagrammatic representation can give a step-by-step solution to a given problem Process operations are represented in these boxes, and arrows connecting them represent flow of control This means programmers can look at the problem they are trying to solve as a set of consecutive processes. The flowchart on the left represents the program to add two numbers. Flow charts have specific shapes for specific kind of processes. The ellipses for example is for start and stop. Start Input a Input b SUM=a+b Input a Output sum Stop

Programming Tools – Algorithms Naija Dukes 2011 Nigeria JUG, Lagos NaijaDukes Another tool used by programmers is algorithms. An algorithm is a step by step description on how to solve a problem. If you have a well defined procedure for doing something, then you have an algorithm. In computers and mathematics, we can say an algorithm describe a computation that, when executed, will proceed through a finite number of well-defined successive states, eventually producing output and terminating at a final ending state. So the key features of an algorithm are, it has a finite state, the states are successive and it must have an entry and an exit point. It is different from flow charts in that flow charts are diagrammatic while algorithms are not. Most algorithms can be translated to flow charts 1.Start 2.Get a number call it A 3.Get a number call it B 4.Set SUM ← A + B 5.Print Sum

2011 Nigeria JUG, Lagos NaijaDukes All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in happy endings and fairy godmothers. Perhaps the hundreds of nitty frustrations drive away all but those who habitually focus on the end goal. Perhaps it is merely that computers are young, programmers are younger, and the young are always optimists. But however the selection process works, the result is indisputable: 'This time it will surely run' or 'I just found the last bug'. Fredrick P. Brooks

NaijaDukes