computer programming 1_1

19
06/22/22 Computer Programming 1

Upload: haida09

Post on 19-Jul-2016

22 views

Category:

Documents


3 download

DESCRIPTION

Introduction to Computer Programming

TRANSCRIPT

Page 1: Computer Programming 1_1

04/28/23Computer Programming 1

Page 2: Computer Programming 1_1

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

04/28/23Computer Programming 2

Page 3: Computer Programming 1_1

Using an interactive development environment (IDE)

Types of programming errors◦ Syntactic◦ Semantic

structured programming language◦ What is a programming language?◦ What is a structured programming language?

04/28/23Computer Programming 3

Page 4: Computer Programming 1_1

Main language concepts covered:◦ Simple data types

Numbers (integer, real) Boolean Characters Strings

◦ Input / output statements◦ Basic statements (assignment, conditionals,

iteration/looping)

04/28/23Computer Programming 4

Page 5: Computer Programming 1_1

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

04/28/23Computer Programming 5

Page 6: Computer Programming 1_1

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?

04/28/23Computer Programming 6

Page 7: Computer Programming 1_1

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

04/28/23Computer Programming 7

Page 8: Computer Programming 1_1

04/28/23Computer Programming 8

Page 9: Computer Programming 1_1

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.

04/28/23Computer Programming 9

Page 10: Computer Programming 1_1

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

04/28/23Computer Programming 10

Page 11: Computer Programming 1_1

The relationship between Hardware and Software

Hardware and software have a symbiotic relationship, this means that without software hardware is very limited; and without hardware, software wouldn’t be able to run at all. They need each other to fulfill their potential.

04/28/23Computer Programming 11

Page 12: Computer Programming 1_1

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)

04/28/23Computer Programming 12

Page 13: Computer Programming 1_1

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.

04/28/23Computer Programming 13

Page 14: Computer Programming 1_1

Central Processing Unit(s)◦ One or more◦ A CPU contains

Arithmetic Logic Unit (ALU) A Control Unit: controls the actions of other components

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

Not all computational systems rely on a central processing unit. An array processor or vector processor has multiple parallel computing elements, with no one unit considered the "center". In the distributed computing model, problems are solved by a distributed interconnected set of processors.

04/28/23Computer Programming 14

Page 15: Computer Programming 1_1

Bus◦ In computer architecture, a bus is a

communication system that transfers data between components inside a computer, or between computers.

◦ covers all related hardware components (wire, optical fiber, etc.) and software, including communication protocols.

04/28/23Computer Programming 15

Page 16: Computer Programming 1_1

Vacuum tubes Mainframe computers (IBM) Mini computers (DEC) Micro computers (IBM, NEC, MacIntosh)

◦ Desktops◦ Laptops◦ Blackberry

Supercomputers Tablets and smartphones

04/28/23Computer Programming 16

Page 17: Computer Programming 1_1

Every year or two computer power approximately doubles◦ Memory size (RAM)

Memory used to execute programs◦ Secondary storage (permanent storage)

E.g. disk storage, used to to hold programs and data over time

◦ Processor speeds Speed at which computers execute their programs

04/28/23Computer Programming 18

Page 18: Computer Programming 1_1

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

04/28/23Computer Programming 19

Page 19: Computer Programming 1_1

http://www.webopedia.com/ http://en.wikibooks.org/wiki/A-

level_Computing/AQA/Computer_Components,_The_Stored_Program_Concept_and_the_Internet/Fundamentals_of_Computer_Systems/Hardware_and_software

04/28/23Computer Programming 20