CSE:141 Introduction to Programming Faculty of Computer Science, IBA BS-I (Spring 2010) Lecture 2.

Slides:



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

Lecture 1: Overview of Computers & Programming
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
1 Chapter 1 Introduction to Object-Oriented Programming.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
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.
The Analytical Engine Module 6 Program Translation.
Chapter3: Language Translation issues
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 1: Getting Started by George Lamperti & BU Faculty.
ICS 102 Computer Programming University of Hail College of Computer Science & Engineering Computer Science and Software Engineering Department.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Computer Science 101 Introduction to Programming.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
CS102 Introduction to Computer Programming
Introduction to Programming G50PRO University of Nottingham Unit 1 : Introduction Paul Tennent
1 Author: Nell Dale Chip Weems Mark Headington Published By Higher Education Press Jones and Bartlett Publishers.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Chapter-01 Introduction to Computers and C++ Programming.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 October 20, October 20, 2015October 20, 2015October 20,
Overview of Programming and Problem Solving Textbook Chapter 1 1.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Lecture 11: 10/1/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Chapter 1 Overview of Programming and Problem Solving 1.
Topic #1: Introduction EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
1 3. Computing System Fundamentals 3.1 Language Translators.
Compiler Design Introduction 1. 2 Course Outline Introduction to Compiling Lexical Analysis Syntax Analysis –Context Free Grammars –Top-Down Parsing –Bottom-Up.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
Chapter 1 Overview of Programming and Problem Solving CS185/09 - Introduction to Programming Caldwell College.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Lecture 2 Programming life cycle. computer piano analogy Piano + player - computer hardware Musical score/notes - software or program Composer - programmer.
 Programming - the process of creating computer programs.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
CS 125 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk drive Software.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
Software Engineering Algorithms, Compilers, & Lifecycle.
Introduction to Computers and Programming
Operating System Interface between a user and the computer hardware
Programming Language Hierarchy, Phases of a Java Program
CSCI-235 Micro-Computer Applications
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Introduction to Computers and Java
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 Overview of Programming and Problem Solving
Problem Solving Skill Area 305.1
What is Computer Programming?
ICS103 Programming in C 1: Overview of Computers And Programming
Presentation transcript:

CSE:141 Introduction to Programming Faculty of Computer Science, IBA BS-I (Spring 2010) Lecture 2

Lesson Plan Introduction to computation Languages Program life cycle 2/3/2010Quratulain2

What is computation? Earlier computer were fixed program (Declarative) – E.g Calculator Now, stored program computers(Imperative) – E.g Computers 2/3/2010Quratulain3

Computer System 2/3/2010Quratulain4

Memory Addressing The capacity (size) of memory is described in terms of number of bytes. RAM capacities in a typical computer range from 512 MB (megabyte) to 3 GB (gigabyte). RAM is volatile – data is lost when power is turned off. Computers don't understand the alphabet. They only understand 0’s and 1’s. So computers map each alphabet character to a series of sixteen 0's and 1's. For example, the letter E is And each of the eight-bit groupings is a byte. 2/3/2010Quratulain5 Address Memory Contents … 50,000 50,001 50,002 50,003 50,004 50,005 …

6 A Programming Language is... a language with strict grammatical rules, symbols, and special words used to construct a computer program

7 Code is... The product of translating an algorithm into a programming language Instructions for a computer that are written in a programming language

Languages High level vs Low level General purpose vs Targeted Interpreted vs Compiled Synatx vs Semantics 2/3/2010Quratulain8

The high level vs low level High-Level Language (HLL) – closest to natural language – words, numbers, and math symbols – not directly understood by hardware – “portable” source code (hardware independent) – Java, C, C++, COBOL, FORTRAN, BASIC, Lisp, Ada, etc. Machine Language (lowest level) – least natural language for humans, most natural language for hardware – just 0s and 1s – directly understood by hardware – not portable (hardware dependent)

Programming Language Hierarchy

General purpose vs Targeted Languages A "general purpose programming language" theoretically should be usable in multiple domains, but not specialized for any of them. A Targeted/Specific purpose programming language. 2/3/2010Quratulain11

Compilers vs. Assemblers vs. Interpreters Compilers and Assemblers – translation is a separate user step – translation is “off-line,” i.e. not at run time Interpreters - another way to translate source to object code – interpretation (from source to object code) is not a separate user step – translation is “on-line,” i.e. at run time Compiler, Assembler, or Interpreter Source Code Object Code

Synatx vs Semantics Semantics – Grammatical rules for assigning meaning to a sentence. Syntax – Grammatical rules for specifying correct word order and inflectional structure in a sentence. Example – “Baby milk drinks“ not correct syntactically but can extract meaning “Baby drinks milk” 2/3/2010Quratulain13

14 Programming Shortcut? THINKING CODE TEST PROBLEM-SOLVING PHASE IMPLEMENTATION PHASE Shortcut? Algorithm Code Problem

15 Programming Life Cycle Problem-Solving Analysis and Specification General Solution ( Algorithm ) Verify Implementation Concrete Solution ( Code ) Test Maintenance Use Maintain

16 Sample Problem A programmer needs an algorithm to determine an employee’s weekly wages How would the calculations be done by hand?

17 One Employee’s Wages During one week an employee works 52 hours at the hourly pay rate $24.75 How much is the employee’s wages? Assume a 40.0 hour normal work week Assume an overtime pay rate factor of x $ = $ x 1.5 x $ = $ ___________ $

18 If hours is over 40.0, then wages = (40.0 * payRate) + (hours ) * 1.5 *payRate otherwise, wages = hours * payRate RECALL EXAMPLE ( 40 x $ ) + ( 12 x 1.5 x $ ) = $ Weekly Wages, in General

19 Employee’s Weekly Wages Objects: Employee, pay rate, hours worked, wages Algorithm: 1. Get the employee’s hourly pay rate 2. Get the hours worked this week 3. Calculate this week’s regular wages 4. Calculate this week’s overtime wages (if any) 5. Add the regular wages to overtime wages (if any) to determine total wages for the week