Introduction to Computers and Programming - Class 1 1 Introduction to Computers and Programming Professor Avi Rosenfeld
Introduction to Computers and Programming - Class 12 Administrative Details Course home page is at Syllabus is accessible from the home page There will be six homeworks, two midterms and a final There will be OPTIONAL homeworks given more frequently Office hours are on Wednesday, 8:30-9:30 A.M., room 419 CIWW, and by appointment
Introduction to Computers and Programming - Class 13 About Me Yeshiva University Web Page:
Introduction to Computers and Programming - Class 14 Important Information See the syllabus for more details on homework, midterms and the final Class participation is important and will help your final grade To proceed with further computer science courses in the undergraduate division, you *MUST* achieve a grade of C or better-NO EXCEPTIONS CAN BE MADE
Introduction to Computers and Programming - Class 15 Introduction The purpose of this course is to teach you about computing, but particularly, programming in C (a powerful, widely-used programming language see Linux). The goal of the course is to introduce you to the world of C.S. and to give you the ability to program independently.
Introduction to Computers and Programming - Class 16 What is a Computer? Device capable of performing computations and enacting logical decisions Computers process data through sets of instructions called computer programs Programs guide the computer through actions as specified by people called computer programmers.
Introduction to Computers and Programming - Class 17 Elements of a Computer Input devices (files, keyboards, mice, etc.) Output device (files, screen, printers, etc.) Memory (video, cache, flash, etc.) Arithmetic and logic unit (ALU) data process Central Processing Unit (CPU) control Secondary Storage (e.g. hard disk, floppy)
Introduction to Computers and Programming - Class 18 Hardware vs. Software Hardware – Physical Components Software – Logical Instructions Firmware – Logical Instructions imprinted on physical Components
Introduction to Computers and Programming - Class 19 How Does a Computer “think”? Transistors form switches that are in “on” or “off” states. The Pentium 4 chip has over 42 million transistors. Each transistor creates one bit. 8 bits create one byte
Introduction to Computers and Programming - Class 110 Why are Bytes Important? ASCII (American Standard Code for Information Interchange) tables Unicode addresses the ASCII limitations
Introduction to Computers and Programming - Class 111 Evolution of the Computer Early computers used batch processing – one job (program) at a time Very inefficient, sometimes days till output produced Often automation techniques still run in batch. Terminals used – “dumb” client Operating systems (OS’s) were first developed to handle switching between jobs Multitasking Multithreading
Introduction to Computers and Programming - Class 112 Personal Computing In 1977, Steve Jobs and Steve Wozniak popularized personal computing with the Apple (proprietary equipment) In 1981, IBM introduced the IBM Personal Computer (PC), using “off-the-shelf” components Today’s top PC’s are as powerful as the million dollar machines of only ten years ago. Aren’t “dumb” terminals.
Introduction to Computers and Programming - Class 113 Programming Languages Machine language Hardware-dependent, cumbersome manipulation of series of numbers (1’s and 0’s) Assembly language, e.g. LOAD BALANCE ADD TAX STORE TOTAL High-level languages (compiled or interpreted) Pascal, Lisp, Ada, Java, Basic, C, C++, etc.
Introduction to Computers and Programming - Class 114 The C Programming Language C was originally created in 1972 by Dennis Ritchie at Bell Labs= C is a relatively low-level high-level language; i.e. deals with numbers, characters, and memory addresses
Introduction to Computers and Programming - Class 115 Functions (“verbs” to Deitel) C programs consist of modules called functions Functions are groups of instructions that operate on data to produce and often return results Known in other languages as methods, procedures, subs, among others
Introduction to Computers and Programming - Class 116 Objects (“Nouns” to Deitel) Object-oriented programming seeks to model the behavior of objects There are data and operations (functions) that work on just that data Benefits Reusability Quicker development Easier maintenance
Introduction to Computers and Programming - Class 117 Structured Programming Disciplined approach to writing programs that are clear, correct and easy to maintain and modify The goal of this course is to make you into structured programming.
Introduction to Computers and Programming - Class 118 Creating Programs in C Six basic steps Edit Preprocess Compile Link Load Execute
Introduction to Computers and Programming - Class 119 Editor Used to create the program and store it on disk (secondary storage) C programs should be saved with a.c extension
Introduction to Computers and Programming - Class 120 Preprocessor Handles various manipulations before compiling, including Inclusion of additional specified files (e.g. stdio.h, stdafx.h) Text replacement Results in more efficient, clearer and less unwieldy code
Introduction to Computers and Programming - Class 121 Compiler Translates the saved program file to machine language (a/k/a object code) and saves it to a file
Introduction to Computers and Programming - Class 122 Linker Links object code from any additional specified files into appropriate places in your code Produces a file that is an executable image of the linked object code and stores it on the disk
Introduction to Computers and Programming - Class 123 Loader Puts the executable image (instructions) from the disk into primary memory
Introduction to Computers and Programming - Class 124 Execute CPU takes each instruction in primary memory and executes it CPU may also store new data values as program executes