Intro to Programming CST 200 - JavaScript. Objectives Define software Identify the different types of software Differentiate the different types of programming.

Slides:



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

Lecture 1: Overview of Computers & Programming
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
Computers Are Your Future
Chapter 1 - An Introduction to Computers and Problem Solving
Introduction to Programming
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
 Control structures  Algorithm & flowchart  If statements  While statements.
Creating Computer Programs lesson 27. This lesson includes the following sections: What is a Computer Program? How Programs Solve Problems Two Approaches:
CS001 Introduction to Programming Day 3 Sujana Jyothi
Lecture 1: Intro to Computers Yoni Fridman 6/28/01 6/28/01.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Computers: Tools for an Information Age
Chapter 16 Programming and Languages: Telling the Computer What to Do.
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Topic 1: Introduction to Computers and Programming
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Your Interactive Guide to the Digital World Discovering Computers 2012.
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer.
Chapter Introduction to Computers and Programming 1.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Programming Languages – Coding schemes used to write both systems and application software A programming language is an abstraction mechanism. It enables.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CHAPTER 1 Overview of Programming and Problem Solving.
An Introduction to Programming with C++ Sixth Edition
UniMAP Sem1-08/09EKT120: Computer Programming1 Week 1 – Lecture 1.
UNIT - 1Topic - 3. Computer software is a program that tells a computer what to do. Computer software, or just software, is any set of machine-readable.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
1 Programming Fundamentals How to Program in C++ How to Program in C++
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Intro to Programming Web Design ½ Shade Adetoro. Programming Slangs IDE - Integrated Development Environment – the software in which you develop an application.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Some Computer Science Conceptual Background Material Doug Hogan This version for UIC Spring 2016 CS 107.
UniMAP Sem2-10/11 DKT121: Fundamental of Computer Programming1 Introduction to C – Part 1.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
1 Overview of Programming Principles of Computers.
Introduction to Computers Lesson 13A. home Computer Program A set of instructions or statements, also called code, to be carried out by the computer’s.
Chapter 1 An Overview of Computers and Programming Languages.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
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.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Introduction to Programming in C++ Seventh Edition Chapter 1: An Introduction to Programming.
What Do Computers Do? A computer system is
CSCI-235 Micro-Computer Applications
Week 1 – Session 1 Pn. Yasmin Yacob 04 – KUKUM Sem2-06/07
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Creating Computer Programs
ICT Gaming Lesson 2.
An Introduction to Programming with C++ Fifth Edition
Creating Computer Programs
Programming Logic and Design Eighth Edition
Presentation transcript:

Intro to Programming CST JavaScript

Objectives Define software Identify the different types of software Differentiate the different types of programming languages – machine language, assembly language, high-level languages Differentiate between procedure-oriented programs and object-oriented programs Understand the three basic control structures: sequence, selection and repetition Define an algorithm 2Intro to Programming

Software vs. Hardware Every computer system combines software and hardware Software is the collection of computer programs and related data that tells a computer what to do – Series of instructions Hardware consists of the physical, electronic, mechanical components – Keyboard, mouse, monitor, memory, hard drive 3Intro to Programming

Types of Software Two categories of software exist: Application software describes computer programs that allow users to perform specific tasks – word processors, web browsers, client System software describes computer programs that operate and control the hardware connected to the computer – Operating systems, device drivers 4Intro to Programming

Programming Computer programming is the art and science of specifying the set of instructions (programs) that tell the computer what to do Computer programs are written in programming languages Just as written languages define symbols and rules that enables humans to communicate, programming languages define symbols and rules that enable humans to communicate with computers 5Intro to Programming

Types of Programming Languages Programming languages fall into different categories, based upon who (or what) is able to understand and execute it Three categories are: – Machine language – Assembly language – High-level language 6Intro to Programming

Machine Language Machine language (machine code) is the series of instructions that a computer (machine) directly understands – Binary language, consisting entirely of 0 and 1’s – Extremely difficult to program – Hardware-dependent: each family of CPU’s (Intel x86, AMD Athlon, etc.) has its own machine code Example machine code: Intro to Programming

Assembly Language Assembly language is a more human-friendly programming language that uses mnemonics in place of 0’s and 1’s in a program – Still difficult to program – Still hardware-dependent – Assembly programs are converted to machine code through an assembler Example assembly language code: SET r1, 10 STORE X, r1 8Intro to Programming

High-Level Language High-level languages allow programmers to write instructions that more closely resemble English language. – Much easier to learn and program – Hardware Independent: high-level programs can be compiled to run on many different computer platforms Example high-level code: var age = 30; 9Intro to Programming

Types of High-Level Languages High-level languages can be classified into different styles, based on how the language conceptualizes a computer program Two main categories of high-level languages are – Procedure-Oriented Languages – Object-Oriented Languages 10Intro to Programming

Procedure-Oriented Programs Procedure-oriented programs conceptualize a computer program as set of processes that call one another, each performing a series of sequential steps In procedure-oriented programs, programmer focuses on the specific steps (or actions) the program must take to solve a task – Very linear, step-by-step Intro to Programming11

Object-Oriented Programs Object-oriented programs conceptualize a computer program as a series of objects that send messages and pass data amongst each other In object-oriented programs, programmer focuses on the objects that interact to perform a task – Objects can be defined to represent real-world things Intro to Programming12

JavaScript Programming Language JavaScript is an Object-based, client-side web programming language – JavaScript is a high-level programming language – JavaScript is used in both a procedure-oriented and object-based way – Object-based, because it does not have all the features of an object-oriented language Intro to Programming13

Control Structures A computer program is a series of instructions that directs a computer to perform a task When writing programs, programmers need ways to control the order that instructions execute – This order of instructions is called the control flow All programming languages contain control structures to dictate the control flow of a program Intro to Programming14

Control Structures Every computer program uses one or more of the three basic control structures: sequence, selection and repetition All three control structures are used by all of us every day in solving problems Intro to Programming15

Control Structure: Sequence In order for each of us to complete a task, we understand that we have to do things one step at a time, in a specific order The sequence control structure directs a computer program to process the program instructions, one after the other, in the order listed on the program Every program uses the sequence control structure Intro to Programming16

Sequence Control Structure Example Imagine we need a program to draw one red lollipop 1.set color to black 2.draw vertical line 3.set color to red 4.draw circle 5.color circle Intro to Programming17

Control Structure: Repetition In order for each of us to complete a task, we often have to repeat some part of the task over and over The repetition control structure directs a computer program to repeatedly perform one or more action (loop) until some condition is met – Often represented with for, while or repeat-until loops Intro to Programming18

Repetition Control Structure Example Imagine we need a program to draw 30 red lollipops repeat 30 times: set color to black draw vertical line set color to red draw circle color circle Intro to Programming19

Repetition Control Structure Example (2) Imagine we need a program to eat a lollipop repeat until the lollipop is gone lick lollipop Intro to Programming20 Each instance of the loop (repetition of the process) is called an iteration Note indentation

Control Structure: Selection In order for each of us to complete a task, we often have to have to make decisions The selection control structure (also called decision structure) directs a computer program to make a decision, and then choose an action based on that decision – Often represented with if-then-else statements Intro to Programming21

Selection Control Structure Example Imagine we need a program to eat a lollipop and then display a message whether or not the lollipop was yummy or not repeat until the lollipop is gone lick lollipop if lollipop tastes yummy display lollipop is yummy else display lollipop is not yummy Intro to Programming22 The decision is based on a condition that evaluates to true or false

Algorithms On the previous slides, the set of instructions that solved the problems are called algorithms An algorithm is a set of step-by-step instructions that accomplish a task The algorithms for all computer programs contain one or more of the sequence, repetition and selection control structures. Intro to Programming23

In-Class Practice Write an algorithm to perform the following tasks (a) Get dressed in the morning (b) Make a cup of tea (c) Cross the street Intro to Programming24