1 Course Focus 1.Programming (any language) PP (Procedural Programming) OOP (Object-Oriented Programming) 2.Problem solving Understand the problem & requirements.

Slides:



Advertisements
Similar presentations
Basic Computer Vocabulary
Advertisements

Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Overview of Programming and Problem Solving ROBERT REAVES.
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Programming Creating programs that run on your PC
COSC 120 Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computers: Tools for an Information Age
Program Flow Charting How to tackle the beginning stage a program design.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
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.
CS 0008 Day 2 1. Today Hardware and Software How computers store data How a program works Operators, types, input Print function Running the debugger.
Neal Stublen Computer Systems Hardware Display Keyboard Mouse Microphone Memory Chips Microprocessor.
Introduction to Computers and Programming
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
CS102 Introduction to Computer 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.
CS 161 INTRO TO PROGRAMMING I Dr. Blaise W. Liffick Fall
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.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Programming Languages: Telling the Computers What to Do Chapter 16.
Introduction to Programming. Our Book in CS Why Program? Lets watch a video
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
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.
Copyright © 2012 Pearson Education, Inc. Chapter 1 Introduction to Computing and Programming.
CISC105 General Computer Science Class 1 – 6/5/2006.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
1 Overview of Programming and Problem Solving Chapter 1.
Visual C++ Programming: Concepts and Projects
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.
Computer Basic Vocabulary
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming Dr. Halla Abdel Hameed.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
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.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming
Java Programming: From the Ground Up
BASIC PROGRAMMING C SCP1103 (02)
Key Ideas from day 1 slides
BASIC PROGRAMMING C SCP1103 (02)
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
ICS103 Programming in C 1: Overview of Computers And Programming
Programming Logic and Design Eighth Edition
Chapter 1: Introduction to Computers and Programming
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

1 Course Focus 1.Programming (any language) PP (Procedural Programming) OOP (Object-Oriented Programming) 2.Problem solving Understand the problem & requirements (I P O S) Design modular program structure Design algorithms Code Test & Debug 3.Java language (the basics) 4.IDE: NetBeans (the basics)

2 What’s “a computer”? Laptop, desktop Mainframe, supercomputer Tablet, smart phone, Tivo, Xbox, … Server: print server, file server, DB server, web server, …

3 2 parts of a computer Hardware (HW) 1.CPU 2.Memory (RAM, …) 3.Storage: Disk, CD, DVD, thumb drive, SD card,… 4.I/O devices 5.Connectivity: network, wifi, bluetooth, ethernet,… Software (SW) programs makes the computer “smart” controls HW hides most HW from user

4 HW – CPU 1) CU (Control Unit) - Boss fetch & decode instruction (the one specified in PC (program counter) ) call & pass data to/from other HW units 2) ALU (Arithmetic & Logic Unit) - Worker arithmetic+ - * / comparisons== != =

1-5 IPO (Input/Processing/Output) Instruction (input)Result (output) Arithmetic Logic Unit Control Unit CPU

6 HW – Storage 1 - Primary storage = Memory (RAM) internal storage temporary, volatile, small, fast-access e.g., 512MB... 4GB, Secondary storage disk, CD, DVD, SD card, thumb drive external storage permanent, large capacity, slow-access e.g., 500GB,... 1TB,... HD (or 8GB flash drive in netbook)...

7 HW – Storage - RAM  “Random Access Memory” contains Currently running PROGRAMS DATA used by those programs  RAM divided into bytes, grouped into words Each word has a unique address

8 bits & bytes & words  A byte = 8 bits a bit is either ON (1) or OFF (0)  A word = 4 bytes (32-bit system) = 8 bytes (64-bit system)  Bytes/words contain: Machine language instruction Data:  1 char (‘A’) stored in 1 byte  1 integer ( ) stored in 4 bytes

9 HW – I/O Input: keyboard, mouse, touchscreen,... camera, scanner, microphone,... file, DB, internet,... Output: screen, printer, AV device,... controller for machine / robot,... file, DB, internet,...

10 SW (programs) system SW OS, utilities, device drivers, compilers, text editors, network SW,... application SW general-purpose  DBMS, MS Office, browser application-specific  Payroll, WMU registration

11 Programmer  Applicationprogrammer  Systems“  Database“  Network“  Web“ ...  Games, AI, graphics,... programmer

12 Program recipe detailed step-by-step set of INSTRUCTIONS tells computer EXACTLY what to do controls HW processes data an algorithm to solve a problem implemented in a programming language

1-13 Algorithm  set of well-defined steps to complete a specific task steps performed sequentially (unless…)  algorithm translated to machine language algorithm written in pseudocode or flowchart or... developer implements algorithm in a high-level language (like Java) compiler produces machine language (all 0’s and 1’s)

14 Software Engineer Programmer - “Developer” Systems Analyst - “Designer” SW Engineering activities: Plan, design, test, document Code(= write program) Develop GUI Develop modules (classes) Customize package Build SW from components...

15 IPO model (IPSO model) Input  Processing  Output & Storing

16 IPO (IPSO) model HUMAN see/hear  [think & remember]  speak/write HW mouse/KB …  [CPU & RAM & disk]  screen, … SW (traditional program) data  [process & store]  data (user/file/DB) ^^^^^^^^^^ [= the PROGRAM]

17 Data  text, numbers  graphics, sound, images, movies,...  mouse clicks (single/double, left/right), mouse hovers,...  web page, text message,...

18 Types of applications  Batch processing Typically: file in, file/printer out  Interactive simple text I/O with user (Console App) GUI(Windows App) (Web App) Java can do all of these CS1110 – mainly Console Applications

19 IPSO - SW windows application user input  [process & store]  screen display mouse clicks   DB data in a form  a SW module (a method) input parameter  [procedure]  return value [& local variables] [& class’s instance variables]

20 Types of Programs/Programming  Event-driven program  Modular program  Visual program  Structured program  Procedural program (next time & …)  Object-orientedprogram (couple weeks) OOP Java can do all of these

21 Event-driven programming IPO: event  [handler module in program]  effects Events: left-mouse-click on button/slider bar/menu item, mouse hovers over X, user hits Enter key, hit F5 key, sensor detects change, change made to the DB,... Programming: write a module to handle ANY event that could happen

22 Windows App vs. Console App Event-driven Windows appConsole app Input:PUSHed into program program by user PULLed into program by program Controller:userprogram (main) Interface:windows/GUI/ visual/web/... console (text) Mode:interactivebatch or simple text I/O

23 Modular programming Program = a collection of small modules A module is: (in Procedural Programming)  an IPSO procedure or function (in Object Oriented Programming)  a Class (object)  a IPSO method within a class  ~ procedure  Programming – write modules Top-down or bottom-up

24 Visual Programming Visual C#, Visual Basic, Java with library of classes 1) Construct GUI from pre-existing components Text box, radio button, slider bar, dropdown list,... 2) Adjust properties of these objects 3) Add procedural code (a module) specifying: WHAT to do for each EVENT that might happen to this object (Much code is automatically generated for an object)

25 Structured Programming All procedural code (Java methods) is made from stacking or nesting of: 1) Sequence Structure action1, action2, action3,... 2) Selection (condition) Structure if conditionX is true then action1 else action2 3) Repetition (loop) Structure while conditionX is true do {action1, action2,... }

Procedural Programming (PP)  Older languages were procedural  A procedure = a set of language statements which do a specific task  Program is mainly a set of procedures  Procedures operate on program’s data typically operate on data items separate from procedure itself  data commonly passed from one procedure to another

1-27 PP  Data tends to be global (available) to entire program & all procedures data being passed to/from (between) procedures  DISADVANTAGE: If data formats change then procedures that operate on that datamust be changed

1-28 Object-Oriented Programming (OOP)  OOP focus: create objects (vs. procedures)  Objects are combo of 1.Data – the attributes of the object 2.Procedures that manipulate that data - methods (behaviors, local procedures, services)

1-29 OOP  Encapsulation - combine data & behavior  Data hiding = object X’s data not visible to other objects in program  Only object X’s methods can directly manipulate object X’s data Other objects can only access/manipulate object X’s attributes via object X’s methods

30 Programming = problem-solving   solution 1)Solve the problem right AND 2)Solve the right problem Determine: WHAT needs to be done HOW to do it(the algorithm)

31 Example Problems  iPhone app  List Song titles in alpha order on iPod  Calculate final grade in CS1110  Candy  Pay off a car loan at X% over Y years  Google Maps – find shortest route KZoo  NY

32 Steps in programming 1.Requirements specification(what) input, processing, output 2.Program design(how) algorithm, modules, GUI 3.Coding (development) [in Java] 4.Testing & debugging compilation & logic & runtime errors validate results 5.Documentation (external) 6.Maintenance

33 Algorithm (the “P” of IPSO) EXAMPLE: find sum of 1 st 100 integers User’s view: BLACK-box Programmer’s view WHITE(“clear”)-box (write & test actual code) Program’s processing could: Look it up in a table / file / DB Crowdsource the microtask on the web Calculate it using Algorthm1 or Algorithm2 or...

34 Construct program from  pre-existing classes/methods in library just need to know interface (I/O)  classes/methods written by programmer

35 Basic Operations (processing) used in a program 1) Actual Work arithmetic comparison( =,, and, or, not) 2) Move/store data AssignmentMem  Mem I/O (Read) KB/mouse/text-on-screen/touchscreen/file/…  Mem I/O (Write) Mem  screen/printer/file/…

36 3) Control the flow (what instruction executes next) default: do next line maybe do this line(if, switch) jump to specific line(loop, break) goto & return(call) 4) Packaging Methods (procedures) Classes

37 1 st & 2 nd Generation Programming Languages Machine Languages (ML) ’s programmers wrote in ML Machine-dependent - each CPU has its own ML (Mac vs. PC) Assembly Languages Add 210(8,13) Machine-dependent

38 3 rd Generation Languages High Level Languages (HLL)  Java, C, C#, C++, Python, Ruby, PHP, Visual BASIC, COBOL, Javascript  Not processor-dependent average = (ex1 + ex2 + ex3) / 3;

39 3 rd Generation Languages 2 main programming paradigms  Procedural (PP) C, COBOL, Fortran, Basic,..., any OOP language can do PP  Object-oriented (OOP) Java, C#, C++, Visual Basic Revised versions of COBOL

40 4 th & 5 th Generation Languages Application-specific Languages e.g., SQL for DBS Select name, phone from student where major = “CS” and state = “MI”; Natural Languages (English,...) If patient is age 65 or older and is disoriented and has pain in his/her left arm then patient could have had a heart attack