Presentation is loading. Please wait.

Presentation is loading. Please wait.

1/16/2008ITK 1681 HardwareSoftware Theory 1800 AD  Architecture 1945 AD  What is Computer Science? Languages 1960 AD 

Similar presentations


Presentation on theme: "1/16/2008ITK 1681 HardwareSoftware Theory 1800 AD  Architecture 1945 AD  What is Computer Science? Languages 1960 AD "— Presentation transcript:

1 1/16/2008ITK 1681 HardwareSoftware Theory 1800 AD  Architecture 1945 AD  What is Computer Science? Languages 1960 AD 

2 1/16/2008ITK 1682 Alan Turing (1912-1954) – The Enigma The man who invented the computer Image from http://ei.cs.vt.edu/~history/Turing.html Turing Machines Turing Award: the Nobel Prize in CS

3 1/16/2008ITK 1683 Said: “Turing Machines are human that compute.” “ In logic nothing is accidental ” Ludwig Wittgenstein (1889-1951) Image from http://www.ags.uci.edu/~bcarver/wgallery.html

4 1/16/2008ITK 1684 Hardware 0 1 1 0 2 4 =16 0 1 0 0 1 1 0 0...... Software

5 1/16/2008ITK 1685 Hardware Input deviceOutput device Central Processor Unit: Internal Storage Control Unit + Arithmetic-Logic Unit (ALU)

6 1/16/2008ITK 1686 Logical Gates for an Adder (half adder) A +)B c S ABcS 0000 0101 1001 1110 AND OR AND NOT B A S c 1 1 0 1 1 1 1 1 1 1 1 0 0 Half-Adder

7 1/16/2008ITK 1687 4 bits Adder Full Adder Full Adder Full Adder Full Adder A B0 110 1 010 1011 0 010 01 0 0 1011 +)0010 1101 100

8 1/16/2008ITK 1688 Software: 1.Operation systems 2.Applications XP, Unix, VAX Words Excel E.I. Hello Java Hello.java javac Hello.class (class loader) Eclipse, NetBean IDE, SunSun

9 1/16/2008ITK 1689 IDE ( Integrated Development Environment ) 1.A customized plain text editor 2.Compiler 3.Loader 4.Debugging tool Java 2 Software Development Kit (J2SDK) Eclipse 1.notepad 2.javac hello 3.java hello 4.......

10 1/16/2008ITK 16810 Solving a problems by computers. 1+2+3+4+..............+98+99+100 = ? 0 + 1 = sum1; sum1+2=sum2 sum2+3=sum3 sum3+4=sum4 sum4+5=sum5 sum5+6=sum6............. sum99+100 = sum100 0+1=1 1+2=3 3+3=6 6+4=10 10+5=15 15+6=21............... 4950+100=5050

11 1/16/2008ITK 16811 Solving a problems by computers. 0 + 1 = sum1 sum1+2=sum2 sum2+3=sum3 sum3+4=sum4 sum4+5=sum5 sum5+6=sum6............. sum99+100 = sum100 sum = 0 sum = sum+1 sum = sum+2 sum = sum+3 sum = sum +4 sum = sum +5............. sum = sum+100 computer can do the same thing again and again fast

12 1/16/2008ITK 16812 Algorithm: a procedure of calculating (manipulate) data 1+2+3+4+.............. +98+99+100 = ? sum = 0 sum = sum+1 sum = sum+2 sum = sum+3 sum = sum +4 sum = sum +5...... sum = sum+100 sum = 0; i = 1; while (i <= 100) do the following { sum = sum + i; i = i+1; } sum is the answer;

13 1/16/2008ITK 16813 Problems  Solutions cycle Problems System analyst, Project leader Algorithms Senior Programmers Programs in JAVA (or any high level Programming Language) compiler Assembly Assembler Machine code linker Results Customers Programmers Syntax Semantics (human) IDE (computers)

14 1/16/2008ITK 16814 How much effort in using an IDE IDE Helps? 2 week from now

15 1/16/2008ITK 16815 How much effort in solving a problem This is more important and difficult; data structures, algorithm analysis This is a basic requirement. We need to reduce this portion 1 year from now

16 1/16/2008ITK 16816 Procedure vs Object To solve a program is: To find a way to manipulate data -- We design procedures Procedure-Oriented Programming Statements + functions  programs To find objects to model the problem – We choose data (object) Object-Oriented Programming Classes + Objects  programs (interfaces, methods, attributes…)

17 1/16/2008ITK 16817 What is “model”? X models an ideal style of Y X  objectsY  problem

18 1/16/2008ITK 16818 Class A class is a concept of something Vehicle 4 wheels, seat, engine, windows…… Truck ………… Sedan ………… SUV …………

19 1/16/2008ITK 16819 Objects: an instance of some class Vehicle SUV Honda Pilot 011-JAV instantiation Class Object

20 1/16/2008ITK 16820 Method & Attribute Each class: Method & Attribute The class designer should determine what kind of methods and attribute its object should have Method: behaviors, service, operation, and functionalities of the object. Field (attribute): the information, status, and properties of the object.

21 1/16/2008ITK 16821 011-JAV Honda Pilot Plate: 011-JAV Color: Blue Engine size: 3.0 L... Start the engine() Stop() Turn (direction) Air()... Services, methods Attributes UML (Unified Modeling Language) class diagram Class name Z.Turn(right) Z

22 1/16/2008ITK 16822 Robot int street int avenue Direction direction ThingBag backback... Robot(City aCity, int aStreet, int aAvenue, Direction aDir) void move() void turnLeft() void pickThing() void putThing()... Services, methods Attributes UML class diagram for Robot Class name Constructor

23 1/16/2008ITK 16823 Modeling what? Modeling Robots with Software Objects - the title o 1.3 But this phrase does not make too much sense to me... Should be: Modeling Robots in a City with Software Classes. Robot int street int avenue Direction direction ThingBag backbag... Robot(City aCity, int aStreet, int aAvenue, Direction aDir) void move() void turnLeft() void pickThing() void putThing()... City String name int stree_No....... City(...........)....

24 1/16/2008ITK 16824 Task: deliver X from (1,2) to (3,1) and step away X 0 1 2 3 4 01234 import becker.robot.*; public class DeliverX{ public static void main(String args[]){ // set up Initial situation City A = new City(); Thing X = new Thing(A,1,2); Robot karel = new Robot(A,0,0, Direction.East); // direct the robot karel.move(); karel.turnLeft(); karel.move(); karel.pickThing(); karek.move(); karel.move(); karel.turnLeft(); karel.move(); karel.putThing(); karel.move(); } named Karel


Download ppt "1/16/2008ITK 1681 HardwareSoftware Theory 1800 AD  Architecture 1945 AD  What is Computer Science? Languages 1960 AD "

Similar presentations


Ads by Google