2 Review of Java - 27/08/2010 Think about representing...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
27/08/2010 1 JAVA REVIEW Lecture 2 CS2110 Fall 2010 Think about representing graphs ± Last time we discussed idea of abstracting problems such as implementing a GPS tracking device for a bicycle into graph ± Might imagine a “class” representing graphs ± Other classes representing nodes, edges ± Graph operations like shortest path used to solve problems like recommending the best route home ± But are computer programming languages well matched to this sort of thing? Machine Language ± Used with the earliest electronic computers (1940s) ± Machines use vacuum tubes instead of transistors ± Programs are entered by setting switches or reading ± Example code ± 0110 0001 0000 0110 add reg1 6 ± An idea for improvement setting switches or reading punch cards ± All instructions are numbers ± Use words instead of numbers ± Result: Assembly Language Assembly Language ± Idea: Use a program (an assembler) to convert assembly language into machine code ± Early assemblers were some of the most complicated code of the time (1950s) ± Example code ADD R1 6 MOV R1 COST SET R1 0 JMP TOP ± Idea for improvement ± Let’s make it easier for humans by designing a high level computer language ± Result: high-level languages High-Level Language ± Idea: Use a program (a compiler or an interpreter ) to convert high-level code into machine code ± Pro ± The whole concept was initially controversial ± Easier for humans to write, read, and maintain code ± Con ± The resulting program was usually less efficient than the best possible assembly-code ² Waste of memory ² Waste of time FORTRAN ± Initial version developed in 1957 by IBM ± Example code C SUM OF SQUARES ISUM = 0 DO 100 I=1,10 ISUM = ISUM + I*I 100 CONTINUE ± FORTRAN introduced many high-level language constructs still in use today ± ± Loops ± Conditionals ± Subroutines ± Comments
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
27/08/2010 2 ALGOL ± Sample code comment Sum of squares begin integer i, sum; ± ALGOL = ALGO rithmic L anguage ± Developed by an international committee ± First version in 1958 (not widely used) ± Second version in 1960 (become a major success) ± ALGOL 60 included recursion ± Pro: easier to design clear, succinct algorithms ± Con: too hard to implement; too inefficient for i:=1 until 10 do sum := sum + i*i; end COBOL ± COBOL = CO mmon B usiness O riented L anguage ± Developed by the US government (about 1960) ± Design was greatly influenced ± COBOL included the idea of records (a single data structure with multiple fields, each field holding a value) by Grace Hopper ± Goal: Programs should look like English ± Idea was that anyone should be able to read and understand a COBOL program ± These languages introduced and popularized Object Oriented Programming (OOP) ± Simula was developed in Norway as a language for simulation in the 60s ± Smalltalk was developed at Xerox PARC in the 70s ± These languages included ± Classes ± Objects
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/30/2011 for the course CS 2110 taught by Professor Francis during the Fall '07 term at Cornell University (Engineering School).

Page1 / 9

2 Review of Java - 27/08/2010 Think about representing...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online