Computer Programming Basics. Computer programs are a detailed set of instructions given to the computer They tell the computer: 1. What actions you want.

Slides:



Advertisements
Similar presentations
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Advertisements

COMPUTER PROGRAMMING I Understand Problem Solving Tools to Design Programming Solutions.
Introduction to Flowcharting
PSEUDOCODE & FLOW CHART
Chapter 1 - An Introduction to Computers and Problem Solving
ME 142 Engineering Computation I Fundamentals of Procedural Computer Programming.
Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK
Basics of Computer Programming Web Design Section 8-1.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Chapter 2- Visual Basic Schneider
Pseudocode and Algorithms
Programming Fundamentals (750113) Ch1. Problem Solving
The Program Design Phases
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Sequencing Miss Regan. Blood Hound  Does anyone know what the Bloodhound project is?  Video 1 Video 1  Video 2 Video 2  Link to website Link to website.
CSC103: Introduction to Computer and Programming
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
6 Steps of the Programming Process
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Flow Charting. Goals Create Algorithms using Flow Charting procedures. Distinguish between Flow Charting and Pseudocode. Top-Down Design Bottom-up Design.
Computer Programming TCP1224 Chapter 2 Beginning the Problem-Solving Process.
EKT150 INTRODUCTION TO COMPUTER PROGRAMMING
C++ If….Else Statements and Flowcharts October 10, 2007.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Introduction to Algorithms Engineering 1D04, Teaching Session 1.
Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.
Flowcharts and Algorithms. Review of Terms  A computer is a machine that can represent and manipulate data –Ultimately the data and the instructions.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Lecture 13: 10/10/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
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.
CS 100 Introduction to Computing Seminar September 21, 2015.
(C)opyright 2000 Scott/Jones Publishers Introduction to Flowcharting.
HOW A COMPUTER PROCESSES DATA. What is hardware? Hardware is the electric, electronic and mechanical equipment that makes up a computer What is software?
Visual Basic Flowcharts October 10, Turn in your vocabulary words before you leave!
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
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,
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Algorithms and Pseudocode
ICS124 Session 9 Flowcharting 1. By the end of this section the student will be able to:  Name the three structures of the Structure Theorem  Identify.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Problem Solving.  Similar to Solving Math Word Problem  Read the Problem  Decide how to go about Solving the Problem  Solve the Problem  Test the.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
CSE 110: Programming Language I Matin Saad Abdullah UB 404.
Algorithms and Flowcharts
Chapter 3 Structured Program Development in C C How to Program, 8/e, GE © 2016 Pearson Education, Ltd. All rights reserved.1.
EKT150 INTRODUCTION TO COMPUTER PROGRAMMING
A451 Theory – 7 Programming 7A, B - Algorithms.
INTRODUCTION TO PROBLEM SOLVING
Basics of Computer Programming
Algorithm & Programming
Basics of Computer Programming
Basics of Computer Programming
Introduction to Computer Programming
Basics of Computer Programming
Programming Fundamentals
An Introduction to Visual Basic .NET and Program Design
Designing an Algorithm
(Course Introduction)
Programming Fundamentals (750113) Ch1. Problem Solving
ME 142 Engineering Computation I
Algorithms.
Computational Thinking
Basic Concepts of Algorithm
Quiz: Computational Thinking
Presentation transcript:

Computer Programming Basics

Computer programs are a detailed set of instructions given to the computer They tell the computer: 1. What actions you want the computer to perform 2. The order those actions should happen in An effective program therefore needs: 1. A thorough understanding of the problem 2. A well thought-out, step-by-step solution to the problem

Computer Programming Basics Working in groups of 2 Create a set of instructions that will tell us: –How to eat a banana Make your instructions as detailed as possible, so that even someone who has never eaten a banana before can understand them ACTIVITY

HOW TO EAT A BANANA: A DETAILED LIST OF INSTRUCTIONS 1. Using your hand, get a yellow crescent-shaped fruit called a “banana” 2. Peel the outer skin off the banana (by breaking off the outer stem and peeling back the yellow peel) 3. Eat the banana 1.Put a small section of banana in your mouth 2.Bite down on the banana 3.Chew the banana by opening and closing your mouth 4.Once the banana has been chewed, swallow the banana 5.Repeat until banana is finished 4. Throw out the used banana peel

Computer Programming Basics A procedure that outlines What actions you want the computer to perform and The order in which they happen is called an ALGORITHM An ALGORITHM is basically an outline for how your computer program will work

Computer Programming Basics Developing an Algorithm is really just a type of Problem Solving –We have to: READ and understand the problem THINK about different solutions to the problem DESIGN an approach that will solve the problem IMPLEMENT that design TEST to see if it works IF NEEDED

Computer Programming Basics THINKING about the solution often means breaking down complex tasks into smaller, easier to understand tasks These tasks must be well-defined so that we understand what the action is acting on –e.g. telling a person to grab a banana will only work if the person knows what a banana is The tasks have to be easy to understand –e.g. telling a person to PEEL a banana will only work if they understand what peeling means

Computer Programming Basics The ORDER in which actions are performed is also very important Consider the following 2 algorithms that tell Mr. Solomon how to get ready in the morning We’ll call them the “Rise-and-Shine Algorithms”

Computer Programming Basics RESULT Mr. Solomon arrives in a great mood ready to teach Mr. Solomon arrives in a great mood ready to teach RESULT Mr. Solomon arrives in not too great a mood since he’s soaking wet  RISE AND SHINE 1 Get out of bed Take off pyjamas Take a shower Get dressed Eat breakfast Drive to school RISE AND SHINE 2 Get out of bed Take off pyjamas Get dressed Take a shower Eat breakfast Drive to school

Computer Programming Basics When the algorithm is written out as a well-thought series of steps, it is sometimes called PSEUDOCODE –It is written in easy to understand language, but is written very similar to the way that you would code it into your 3 rd Generation Language

HOW TO EAT A BANANA: A DETAILED LIST OF INSTRUCTIONS 1. Using your hand, get a yellow crescent-shaped fruit called a “banana” 2. Peel the outer skin off the banana (by breaking off the outer stem and peeling back the yellow peel) 3. Eat the banana 1.Put a small section of banana in your mouth 2.Bite down on the banana 3.Chew the banana by opening and closing your mouth 4.Once the banana has been chewed, swallow the banana 5.Repeat until banana is finished 4. Throw out the used banana peel

Computer Programming Basics The algorithm can also be written as a FLOW CHART The FLOW CHART is a graphic organiser (a picture that helps organize your thoughts) It uses a collection of basic symbols that are used to organize your algorithm These symbols are connected by arrows that show how the algorithm “flows”

Computer Programming Basics FLOW CHART SYMBOLS TERMINAL – the beginning or ending of a program INPUT/OUTPUT – where the user of the program is asked for information (INPUT) or where the program displays a result (OUTPUT) PROCESSING – shows any mathematical operation CALL – shows any other pieces of the program that are called upon DECISION – represents any action where the computer is making a decision

Computer Programming Basics START READ A VALUE MULTIPLY THE VALUE BY 2 AND STORE IN x DISPLAY THE VALUE ENTERED AND x STOP e.g. a Basic Flow Chart

Computer Programming Basics START EAT BREAKFAST GET DRESSED TAKE A SHOWER TAKE OFF PYJAMAS GET OUT OF BED DRIVE TO SCHOOL END