1 / 15

Unit 4

Unit 4 . Introduction to Computer Programming. Programming Topics. Concepts & definitions software, program, language types, compiler, IDE, problem solving, debugging Program language elements Executable statements and comments

ada
Download Presentation

Unit 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unit 4 Introduction to Computer Programming

  2. Programming Topics • Concepts & definitions • software, program, language types, compiler, IDE, problem solving, debugging • Program language elements • Executable statements and comments • Keywords, variables, functions, procedures, data (literal, variable) • Syntax correctness (like spelling) • Logic correctness (like grammar sequence) • Using a programming language – e.g. Turing • Comments & style (heading section) • Text output & formatting • Numerical output & calculations (operators, BEDMAS) • Variables, constants, assignment, and input statements • Graphic procedures (drawing font) • Loops (repetition) • Decision points (selection) • Interfacing & advanced procedures, processes & functions

  3. What is a Computer Program? • A sequence of instructions written in a computer language, which performs some task.

  4. Types of Programming Languages • High level: Uses human-like commands. Example languages: Basic, Java, C , C++, VB, Fortran, Cobol, Turing • Low Level: more technical assembler languages designed for a specific microprocessor (e.g. Pentium 4, Motorola 68000, Intel 8088, PIC16F627). • Binary: Machine language (1's and 0's) for digital circuits.

  5. The Compiler Program • A compiler (or an interpreter) is a special program that translates from high-level (source code) to low-level (object code) before the program is executed by the CPU. • The object code can be 'run' or executed. SOURCE CODE e.g. put "Hello" OBJECT CODE (executable binary code) 10101000010…. COMPILER or INTERPRETER program

  6. Integrated Development Environment (IDE) • A program used to create, edit, compile, run, and debug (repair) programs in a given language. • The IDE may also include features like colour coding of different keywords help the programmer. • It is the main tool to create source code, compile, and test a program • More advanced IDE’s exist: http://www.indigorose.com/autoplay-media-studio/screenshots-autoplay-media-studio/

  7. Problem Solving Approach • Describe the problem to be solved • Analyze information, break into sub-problems as needed • Define IPO steps (what outputs needed, what inputs & processing needed). Use pseudo code & flow charts to display it • Code into a programming language • Test & debug

  8. Pseudo Code & Flow Charts & Screen Shots • Planning tools for problem solving • Complete before coding your program Pseudo code • Point form solution step-by-step in English (which is also used to document the program with comments) Flow Chart • Diagram to illustrate sequence of different steps Screen Shots • Sketch a sequence of screen displays to the user like a story board

  9. start Input Processing Task If … ? yes no Output Basic Flow Chart Symbols Selection / Decision (if, then, else) Start / End Process Input or Output Flow lines C connector

  10. Screen Shots • Divide a page into 6 boxes • Create a story board of your program’s main screens • Used mainly to decide user interface graphic design and layout

  11. Rubric for Programming • Uses planning tools for problem solving • Follows the problem solving process steps • Completes pseudo code & flow charts • Uses good programming style • documentation heading section, comments, good variable names, etc • Program Coding • Program runs ( no syntax errors) • Program provides the solution to the problem • Efficient use of language ( e.g. minimum lines of code)

  12. Can you answer these questions? • What is a computer program? • Define high-level programming languages? • What is a compiler? • What is an IDE? • What are the general problem solving steps? • Use pseudo code and flow charts to solve a given problem • Show that you can create and analyze Turing programs

  13. Interfacing • Interfacing is the hardware and/or software required to connect 2 different analog or digital systems. Digital Computer Interface Analog System (A/V, motion, sensors, etc)

  14. Why interfacing • Changes may be needed between different parts of a system • Possible reasons include: • Different voltage, current requirements • Analog versus digital • Different protocols • Common PC interfaces: • USB, Serial/Parallel Port, Internal buses, etc.

  15. Parallel Port Interface Example Vcc Device Npn Transistor 0 v

More Related