190 likes | 214 Views
CMP 131 Introduction to Computer Programming. Violetta Cavalli-Sforza Week 1, Lecture 1. Course Description. Introduction to algorithms and programming What is an algorithm? What is programming? Programming philosophy How to think of a programming problem
E N D
CMP 131Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lecture 1 CMP 131 Introduction to Computers and Programming
Course Description • Introduction to algorithms and programming • What is an algorithm? • What is programming? • Programming philosophy • How to think of a programming problem • How to plan the solution to the problem • Problem decomposition • Top-down refinement CMP 131 Introduction to Computers and Programming
Course Description (2) • Using an interactive development environment (IDE) • Types of programming errors • Syntactic • Semantic • Using a structured programming language (Pascal) • What is a programming language? • What is a structured programming language? CMP 131 Introduction to Computers and Programming
Course Description (3) • Main language concepts covered: • Simple data types • Numbers (integer, real) • Boolean • Characters • Strings (NOT structured/complex data types) • Input / output statements • Basic statements (assignment, conditionals, iteration/looping) CMP 131 Introduction to Computers and Programming
Course Objectives • Understand basic components in a computer architecture • Appreciate the role of programming languages • Design a top-down solution for solving problems • Be familiar with an IDE • Edit, compile, debug and run short programs CMP 131 Introduction to Computers and Programming
Logistics • Detailed description • Will have to wait a little bit because … • I will post it on the web, as well as assignments, etc. • Class meetings (each week): • Mon,Wed: lectures (1.5 hours each) • Thu: lab (1.5 hours) CMP 131 Introduction to Computers and Programming
Assessments • Exams (50%) • midterm (7th week) – 20% • final (end of course) – 30% • Quizzes (30%) • measure progress • every 2 weeks • Homework (10%) … will say more • Participation (10%) • attendance • will I remember who you are? CMP 131 Introduction to Computers and Programming
Homework • Initially not programming, but thinking about programs • Small programs, 1 or more, depending on the complexity • Frequently assigned (each week) • Like a language, you need frequent practice • Do not wait until the last moment to work on your program CMP 131 Introduction to Computers and Programming
Homework • Expect (esp. true of programming HW): • I will assign homework on Monday • I will take questions on it on Wednesday • I will help you out on Thursday during lab • You will submit it by mail on Friday • I will discuss briefly on following Monday CMP 131 Introduction to Computers and Programming
Computers CMP 131 Introduction to Computers and Programming
What is a computer? • Computer • one that computes (Webster’s dictionary) • In other languages: • French: ordinateur (from “order”) • Italian: cervello elettronico (“electronic brain”) • Other? • Computer: a programmable device that can store, retrieve and process data. CMP 131 Introduction to Computers and Programming
What’s in a Computer? • Hardware: • The actual physical machine • Consists of several hardware devices • Software: • The programs that tell the machine what to do, i.e. give instructions to the machine • Different types of programs written in different languages CMP 131 Introduction to Computers and Programming
Hardware Devices • Input: • Keyboard • Mouse, Touchpad, Joystick • Pen & tablet, Perforated cards • Output: • Printer • Screen (monitor) • Teletype • Input & Output: • Auxiliary Devices: • disks (hard disk, floppies, DVDs/CDs, USB keys, Flash memories) • tape drives • Touch screen • Network cards (intranet, internet) CMP 131 Introduction to Computers and Programming
Hardware Devices (2) • Memory • Permanent: Disks & other I/O devices • Volatile: Main memory, Graphic memories • Virtual Main memory is like a very large set of mailboxes, each with its own address. It stores data encoded as binary numbers. CMP 131 Introduction to Computers and Programming
Hardware Devices (3) • Central Processing Unit(s) • One or more • A CPU contains • Arithmetic Logic Unit (ALU) • A Control Unit: controls the actions of other components • Special Floating Point processors • The CPU controls just about everything else by executing instructions • stores data in memory • retrieves data from memory • performs computations • sends and gets data from other devices CMP 131 Introduction to Computers and Programming
Hardware Devices (3) • Bus: A group of wires through which the other devices communicate. I/O devices are controlled by drivers, which are very specialized kinds of programs CMP 131 Introduction to Computers and Programming
Computers through Time • Vacuum tubes • Mainframe computers (IBM) • Mini computers (DEC) • Micro computers (IBM, NEC, MacIntosh) • Desktops • Laptops • Blackberry • Supercomputers CMP 131 Introduction to Computers and Programming
Hardware Trends • Every year or two computer power approximately doubles • Memory size (RAM) • Memory used to execute programs • Secondarystorage (permanent storage) • E.g. disk storage, used to to hold programs and data over time • Processor speeds • Speed at which computers execute their programs CMP 131 Introduction to Computers and Programming
Hardware/Software Trends • Applications: • Rapidly increasing hardware power allows applications to get bigger and more complex • Costs • Hardware costs dropping • Software development costs rising • Software development complexity • Programmer salaries • Cost of slipping schedules • Unanticipated interactions in complex systems • Unpredictability of software development times CMP 131 Introduction to Computers and Programming