Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Programming CS 1 Introduction to Computers and Computer Technology Rick Graziani Fall 2015.

Similar presentations


Presentation on theme: "Computer Programming CS 1 Introduction to Computers and Computer Technology Rick Graziani Fall 2015."— Presentation transcript:

1 Computer Programming CS 1 Introduction to Computers and Computer Technology Rick Graziani Fall 2015

2 Rick Graziani graziani@cabrillo.edu2 Computer Architecture Central Processing Unit (CPU) or processor –Arithmetic/Logic unit (ALU) Performs operations on data such as addition and subtraction –Control unit Coordinating the CPU’s activities Holds input and results (output) for the ALU –Registers Temporary storage for the CPU –General registers –Special purpose registers

3 Rick Graziani graziani@cabrillo.edu3 A CPU can be: 1. A series of integrated circuits (chips) on one or more circuit boards –Older mainframe and minicomputers 2. On a single integrated circuit known as a microprocessor microprocessor = a CPU on a single chip microcomputer = older term for a computer with a microprocessor(s) (PC, Macintosh)

4 Rick Graziani graziani@cabrillo.edu4 Computer Architecture Bus –Used to transfer bits between the CPU and RAM (main memory)

5 Rick Graziani graziani@cabrillo.edu5 User interface 2+ 3 = 5 User Types (Input) Computer Outputs

6 Rick Graziani graziani@cabrillo.edu6 Computer Architecture Task: Add two values stored in main memory (RAM) –Data (two values) must be transferred from main memory to registers within the CPU –ALU: Values are added –Result stored in main memory (RAM) Value = 2 Value = 3 2 + 3 = 5 Value = 5

7 Rick Graziani graziani@cabrillo.edu7 Computer Architecture Task: Add two values stored in main memory (RAM) –Data (two values) must be transferred from main memory to registers within the CPU –ALU: Values are added –Result stored in main memory (RAM) 2 3 2 + 3 = 5 2 3 2 + 3 5 = 5

8 Rick Graziani graziani@cabrillo.edu8 Our CPU and the Pentium CPU

9 Rick Graziani graziani@cabrillo.edu9 Stored Program Concept Stored program concept: A program can be encoded as bit patterns and stored in main memory. –CPU can then: extract the instructions as needed (copy them into its registers) execute them Program instruction

10 Rick Graziani graziani@cabrillo.edu10 Terminology Machine instruction: An instruction (or command) encoded as a bit pattern recognizable by the CPU Machine language: The set of all instructions recognized by a machine (CPU) Op-code OperandDescription 1RXY LOAD reg. R from cell XY. 2RXY LOAD reg. R with XY. 3RXY STORE reg. R at XY. 40RS MOVE R to S. 5RST ADD S and T into R. (2’s comp.) 6RST ADD S and T into R. (floating pt.) 7RST OR S and T into R. 8RST AND S and T into R. 9RST XOR S and T into R. AR0X ROTATE reg. R X times. BRXY JUMP to XY if R = reg. 0. C000 HALT.

11 Rick Graziani graziani@cabrillo.edu11 Machine Language Philosophies Reduced Instruction Set Computing (RISC) –Few, simple, efficient, and fast instructions –Examples: PowerPC from Apple/IBM/Motorola and SPARK from Sun Microsystems Complex Instruction Set Computing (CISC) –Many, convenient, and powerful instructions –Example: Pentium from Intel Op-code OperandDescription 1RXY LOAD reg. R from cell XY. 2RXY LOAD reg. R with XY. 3RXY STORE reg. R at XY. 40RS MOVE R to S. 5RST ADD S and T into R. (2’s comp.) 6RST ADD S and T into R. (floating pt.) 7RST OR S and T into R. 8RST AND S and T into R. 9RST XOR S and T into R. AR0X ROTATE reg. R X times. BRXY JUMP to XY if R = reg. 0. C000 HALT. Analogy Chinese characters: (CISC) –More complex than English (RISC) words –200 English letters might require only 20 Chinese characters. –Chinese requires fewer symbols –Saves on both paper and postage. However, reading and writing Chinese is more complex –Because each symbol contains more information The English words are analogous to RISC instructions, Chinese symbols are analogous to CISC instructions. This slide is now just an FYI

12 Rick Graziani graziani@cabrillo.edu12 Machine Instruction Types –Data Transfer: Copy data from one location to another –Arithmetic/Logic: Use existing bit patterns to compute a new bit patterns –Control: Direct the execution of the program More in a moment Op-code OperandDescription 1RXY LOAD reg. R from cell XY. 2RXY LOAD reg. R with XY. 3RXY STORE reg. R at XY. 40RS MOVE R to S. 5RST ADD S and T into R. (2’s comp.) 6RST ADD S and T into R. (floating pt.) 7RST OR S and T into R. 8RST AND S and T into R. 9RST XOR S and T into R. AR0X ROTATE reg. R X times. BRXY JUMP to XY if R = reg. 0. C000 HALT.

13 Rick Graziani graziani@cabrillo.edu13 Adding values stored in memory 2 3 5 2+3=5

14 Rick Graziani graziani@cabrillo.edu14 Using machine language

15 Rick Graziani graziani@cabrillo.edu15 Computer Architecture 2 3 2 3 2 + 3 5 = 5 6C 6D 6E 5 6 5 0

16 Rick Graziani graziani@cabrillo.edu16 Adding values stored in memory Data Transfer –Instructions that request the movement (copying) of data from one location to another Step 1 Step 2 Step 3 Step 4 Step 5 2 3 2 3 2 + 3 5 = 5 6C 6D 6E 5 6 5 0

17 Rick Graziani graziani@cabrillo.edu17 Adding values stored in memory ALU –Instructions that tells the control unit to request an activity within the ALU –Capable of performing operations other than basic arithmetic operations, including: AND, OR, XOR. Step 1 Step 2 Step 3 Step 4 Step 5 2 3 2 3 2 + 3 5 = 5 6C 6D 6E 5 6 5 0

18 Rick Graziani graziani@cabrillo.edu18 Remember our half-adder? Adding two bits Adding two, eight bit values involves a similar process, just more gates (2 + 3 = 5): 00000010 + 00000011 = 00001001 Inputs: A, B S = Sum C = Carry AND XOR A + B = 2’s 1’s 0 1 = 0 1 10 SC 1 0 0 + 1 ---- 1

19 Rick Graziani graziani@cabrillo.edu19 Adding values stored in memory Control –Instructions that direct the execution of the program Jump or Branch instructions: Directs the CPU to execute an instruction other than the next one in the list. Unconditional Jump: Skip to Step 6 Condition Jump: If the value is 0 then Skip to Step 6 Step 1 Step 2 Step 3 Step 4 Step 5

20 Rick Graziani graziani@cabrillo.edu20 The architecture of our machine Main Memory –256 cells: 00 through FF (Hex) 0000 0000 through 1111 1111 –Storage: 8 bits per cell CPU –16 registers: 0 through F (Hex); 8 bits per cell –Program counter: (Address of) Keeps track of the next instruction –Instruction register: Contains the current instruction to be executed by the ALU. Address 00000001 00000010 00000011 11111111 00000000

21 Rick Graziani graziani@cabrillo.edu21 Converting Decimal, Hex, and Binary Dec. Hex. Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 1 Hex digit = 4 bits

22 Rick Graziani graziani@cabrillo.edu22 Loading instructions into the computer

23 Rick Graziani graziani@cabrillo.edu23 Parts of a Machine Instruction Machine Language Each instruction involves two parts: –Op-code: Specifies which operation to execute LOAD, ADD, STORE, etc. –Operand: Gives more detailed information about the operation Interpretation of operand varies depending on op-code Op-code OperandDescription 1LOAD reg. R from cell XY. 2LOAD reg. R with XY. 3STORE reg. R at XY. 4MOVE R to S. 5ADD S and T into R. (2’s comp.) 6ADD S and T into R. (floating pt.) 7OR S and T into R. 8AND S and T into R. 9XOR S and T into R. AROTATE reg. R X times. BJUMP to XY if R = reg. 0. CHALT. 0011 0101 1010 0111 Binary (16 bits) 1 Hex digit = 4 bits

24 Rick Graziani graziani@cabrillo.edu24 Parts of a Machine Instruction Op-code OperandDescription 1LOAD reg. R from cell XY. 2LOAD reg. R with XY. 3STORE reg. R at XY. 4MOVE R to S. 5ADD S and T into R. (2’s comp.) 6ADD S and T into R. (floating pt.) 7OR S and T into R. 8AND S and T into R. 9XOR S and T into R. AROTATE reg. R X times. BJUMP to XY if R = reg. 0. CHALT. Store the bits found in register 5 in main memory cell A7 88 A 7 1010 01115

25 Rick Graziani graziani@cabrillo.edu25 The machine cycle

26 Rick Graziani graziani@cabrillo.edu26 Program Execution

27 Rick Graziani graziani@cabrillo.edu27 The program is stored in main memory ready for execution The program is copied put into main memory. –Typically from permanent storage. –Requires two memory cells per instruction: Instructions are 16 bits; memory cells are 8 bits Program counter contains first instruction: A0 00 FF 1 Hex digit = 4 bits Hard Disk Drive

28 Rick Graziani graziani@cabrillo.edu28 Performing the fetch step of the machine cycle

29 Rick Graziani graziani@cabrillo.edu29 At the beginning of the first fetch: –Program Counter = A0 0 5 6 Instruction Register Program Counter Registers A0 … 6E 6C 6D 02 03

30 Rick Graziani graziani@cabrillo.edu30 At the beginning of the first fetch: –Instruction at A0 (and A1) loaded into Instruction register –Program Counter = A2 0 Instruction Register Program Counter Registers 6E 6C 6D 02 03 … 156C A0A2 5 6

31 Rick Graziani graziani@cabrillo.edu31 CPU analyzes the instruction Loads Register 5 with the contents of memory cell address 6C. 156C 0 5 6 Instruction Register Program Counter Registers A2 … 6C 6D 02 03 Load register 5 in main memory cell 6C 6E 02

32 Rick Graziani graziani@cabrillo.edu32 At the beginning of the next fetch: –Program Counter = A2 02 0 5 6 Instruction Register Program Counter Registers A2 … 6C 6D 02 03 6E

33 Rick Graziani graziani@cabrillo.edu33 Instruction at A2 (and A3) loaded into Instruction register Program Counter incremented: A4 CPU analyzes the instruction Loads Register 6 with the contents of memory cell address 6D. 02 0 5 6 Instruction Register Program Counter Registers … 6C 6D 02 03 Load register 6 in main memory cell 6D 6E A2 166D 03 A4

34 Rick Graziani graziani@cabrillo.edu34 At the beginning of the next fetch: –Program Counter = A4 02 03 0 2 3 Instruction Register Program Counter Registers A4 … 6C 6D 02 03 6E

35 Rick Graziani graziani@cabrillo.edu35 Instruction at A4 (and A5) loaded into Instruction register Program Counter incremented: A6 CPU analyzes the instruction Adds contents of register 5 and register 6, storing the result into register 0. 02 03 0 5 6 Instruction Register Program Counter Registers … 6C 6D 02 03 Add: result into register 0, adding contents of register 5 and register 6 6E A4A6 5056 05 Adds contents of register 5 and 6, placing result into register 0.

36 Rick Graziani graziani@cabrillo.edu36 At the beginning of the next fetch: –Program Counter = A6 05 02 03 0 2 3 Instruction Register Program Counter Registers A6 … 6C 6D 02 03 6E

37 Rick Graziani graziani@cabrillo.edu37 Instruction at A6 (and A7) loaded into Instruction register Program Counter incremented: A8 CPU analyzes the instruction Stores contents of register 0 in the memory cell at address 6E. 05 02 03 0 5 6 Instruction Register Program Counter Registers … 6C 6D 02 03 Store contents of register 0, in memory cell address 6E 6E 05 A6 A8 306E

38 Rick Graziani graziani@cabrillo.edu38 At the beginning of the next fetch: –Program Counter = A8 05 02 03 0 5 6 Instruction Register Program Counter Registers A8 … 6C 6D 02 03 6E 05

39 Rick Graziani graziani@cabrillo.edu39 Instruction at A8 (and A9) loaded into Instruction register Program Counter incremented: AA CPU analyzes the instruction Halts the program. (Program ends.) 05 02 03 0 5 6 Instruction Register Program Counter Registers A8 … 6C 6D 02 03 Halt the program 6E 05 AA C000

40 Rick Graziani graziani@cabrillo.edu40 Algorithm An algorithm is an ordered set of unambiguous, executable steps that defines a terminating process. Algorithms are part of many activities, even mundane ones. Note: Researchers believe that the human mind including imagination, creativity, and decision making, is actually the result of algorithm execution. –This is used in artificial intelligence

41 Rick Graziani graziani@cabrillo.edu41 Example Obtain a basket of unshelled peas and an empty bowl. As long as there are unshelled peas in the basket continue to execute the following steps: a. Take a pea from the basket b. Break open the pea pod c. Dump the peas from the pod into the bowl d. Discard the pod

42 Rick Graziani graziani@cabrillo.edu42 Defining the Algorithm An algorithm is an ordered set of unambiguous, executable steps that defines a terminating process. –Steps do not have to be executed in sequence. Non-Terminating Sequence: –Make a list of positive integers. –The above requirement could not be performed in an algorithm, because it does not terminate (it is infinite). Unambiguous –The instructions must be clear, specific and direct –No room for creativity or interpretation 1 2 3 4 5 6 7 8 9 10 11 … (this could go on for ever!) Non-terminating sequence Ambiguous Organize the CDs(By title? By artist? By genre?)

43 Rick Graziani graziani@cabrillo.edu43 Abstract Nature of Algorithms An algorithm can represented in several ways. Example: Algorithm to convert temperatures from Celsius to Fahrenheit: –As an algebraic formula: F = (9/5)C + 32 –As a written instruction: Multiply the temperature reading in Celsius by 9/5 and then add 32

44 Rick Graziani graziani@cabrillo.edu44 Algorithm Representation Algorithm requires some form of a language. Algorithm is a form of communication –Don’t want misunderstandings –Proper level of detail –Proper level of difficulty Problems arise when: –Steps not precisely defined –Not enough detail

45 Rick Graziani graziani@cabrillo.edu45 Primitive – A well defined set of building blocks (terms) used in computer science. –Arithmetic and logic operations built into the language –Removes any ambiguity –Includes its own syntax Programming language – A collection of primitives (terms) and the rules that state how the primitives can be combined to represent more complex ideas. Algorithm Representation LOAD reg. R from cell XY Op-code Description 1LOAD reg. R from cell XY. 2LOAD reg. R with XY. 3STORE reg. R at XY. 4MOVE R to S. 5ADD S and T into R. (2’s comp.) 6ADD S and T into R. (floating pt.) 7OR S and T into R. 8AND S and T into R. 9XOR S and T into R. AROTATE reg. R X times. BJUMP to XY if R = reg. 0. CHALT.

46 Rick Graziani graziani@cabrillo.edu46 Machine language uses primitives High-level programming languages (C++, Java) use higher-level primitives, constructed from the lower-level machine language primitives. This results in an easier set of instructions to write. More later. Store the bits found in register 5 in main memory cell A7 Op-code OperandDescription 1LOAD reg. R from cell XY. 2LOAD reg. R with XY. 3STORE reg. R at XY. 4MOVE R to S. 5ADD S and T into R. (2’s comp.) 6ADD S and T into R. (floating pt.) 7OR S and T into R. 8AND S and T into R. 9XOR S and T into R. AROTATE reg. R X times. BJUMP to XY if R = reg. 0. CHALT.

47 Rick Graziani graziani@cabrillo.edu47 Pseudocode Pseudocode – A notational system in which ideas can be expressed informally during the algorithm development process. (written sentence) Used independently of the programming language. –Each programming language has its own primitives and rules. Pseudocode 1. Enter two numbers. 2. Add the numbers together. 3. Display the result.

48 Rick Graziani graziani@cabrillo.edu48 Pseudocode Conditional selection The selection of one of two possible activities depending upon the truth or falseness of some condition if condition then action or if condition then (activity) else (activity) If this condition is true, perform this activity. If (sunny) then (put on sunscreen) If this condition is true, perform this activity, otherwise perform a different activity. If (sunny) then (go swimming) else (go bowling)

49 Rick Graziani graziani@cabrillo.edu49 Repeating structure Another common semantic structure is the repeated execution of a statement or sequence of statements as long as some condition remains true. while condition do activity Also known as a while loop Examples: while (tickets remain to be sold) do (sell a ticket)

50 Rick Graziani graziani@cabrillo.edu50 Repeating structure Task: Write Hello 500 times. Pseudocode Counter = 1 While counter is less than or equal to 500, write the word “Hello” and add 1 to Counter. Programming Code Counter = 1 While (counter <= 500) do (print “Hello”; Counter  Counter + 1) Counter 1 Hello 2 3 4 500501 Hello …

51 Rick Graziani graziani@cabrillo.edu51 For loop A for loop can be used to accomplish the same thing as a while loop. Note: There are some differences between while and for loops. Counter = 1 For (Counter <= 500) do (print the message “Hello”; Counter  Counter + 1) Counter 1 Hello 2 3 4 500501 Hello …

52 Rick Graziani graziani@cabrillo.edu52 For loop A for loop can be used to accomplish the same thing as a while loop. Note: There are some differences between while and for loops. For (Counter = 1; Counter <= 500; Counter  Counter + 1) do (print the message “Hello”) Counter 1 Hello 2 3 4 500501 Hello …

53 Rick Graziani graziani@cabrillo.edu53 Programming Concepts Program consists of: –Declarative statements Variables and data types –Imperative statements Procedures, instructions, and algorithms –Comments Enhance readability Used throughout the program

54 Rick Graziani graziani@cabrillo.edu54 Variables and Data Types Variable – A location in RAM (main memory), given a descriptive name, which stores information. Data type – Variables are a type of day which can be: –Number Integer: 0, 1, 2, 3, 4, 5, 6, etc. Real (floating point): 9.75, 300.5412 –Character: a, b, c, A, B, C, etc. –String of text: “123 Main Street” Working area or scratch pad for the program. 125 9.75 d Integer Float Character Variable

55 Rick Graziani graziani@cabrillo.edu55 Data structure Variables are often associated with a data structure. Data structure – A conceptual shape of arrangement of data Homogeneous Array –Block of values of the same type –Such as a one dimensional list or a two dimensional array (row, column) Example: String or array of characters –char Last_Name[25] 1 2 3 4 5 … … 24 25 B o o l o o t i a n char Last_Name[25]

56 Rick Graziani graziani@cabrillo.edu56 Data structure Two dimensional array –Row and column –Integer pins [bowler, frame] Dan Sue Gary Mary 3 12 0 7 6 9 1 7 Integer pins [bowler, frame] Frame 1 2 345678910 pins [Mary, 2] = 7

57 Rick Graziani graziani@cabrillo.edu57 Assigning Value Assignment statement – Statement which assigns a value to a variable. –Value assigned from user input –Value assigned from another variable –Value assigned from a specific value –Value assigned from a calculation that can include both variables and assigned values. 125 9.75 d Integer Float Character Fahrenheit = (9/5)Celcius + 32

58 Rick Graziani graziani@cabrillo.edu58 1#include This is a preprocessor command that includes standard input output header file (stdio.h) from the C library before compiling a C program 2int main() This is the main function from where execution of any C program begins. 3{ This indicates the beginning of the main function. 4/*_some_comments_*/ whatever is given inside the command “/* */” in any C program, won’t be considered for compilation and execution. 5printf(“_____________”); printf command prints the output onto the screen. 6getch(); This command waits for any character input from keyboard. 7return 0; This command terminates C program (main function) and returns 0. 8} This indicates the end of the main function

59 #include int main() { printf("Hello world"); return 0; } Note: Actual syntax has been simplified Display “Hello world” End the program

60 #include int main() { printf("Hello world\n"); return 0; }

61 #include int main() { int a; printf("Enter an integer"); scanf(a); printf("Integer that you have entered is”, a); return 0; } Note: Actual syntax has been simplified Display “Enter an integer” User enters a number Display “Integer you have entered is” Display the number the user entered End program

62 #include int main() { int a; printf("Enter an integer\n"); scanf("%d", &a); printf("Integer that you have entered is %d\n", a); return 0; }

63 #include int main() { int a, b, c; printf("Enter two numbers to add "); scanf(a,b); c = a + b; printf("Sum of entered numbers = ",c); return 0; } Note: Actual syntax has been simplified Display “Enter two numbers to add” User enters two numbers Add the two numbers Display “Sum of the entered numbers = “ and the sum End program

64 #include int main() { int a, b, c; printf("Enter two numbers to add\n"); scanf("%d%d",&a,&b); c = a + b; printf("Sum of entered numbers = %d\n",c); return 0; }

65 #include int main() { int n; printf("Enter an integer"); scanf(n); if (n/2 = 0) printf("Even"); else printf("Odd"); return 0; } Note: Actual syntax has been simplified Display “Enter an integer” User enters an integer Determine if the integer is even If the integer is even display “Even” Else display “Oven” End program

66 #include int main() { int n; printf("Enter an integer\n"); scanf("%d", &n); if (n%2 == 0) printf("Even\n"); else printf("Odd\n"); return 0; }

67 Rick Graziani graziani@cabrillo.edu67 “I want you to write on the chalk board, ‘I will not throw paper airplanes in class’, 500 times.”

68 Rick Graziani graziani@cabrillo.edu68 Programming Concepts Count 1 I will not throw paper airplanes in class. 2 3 … 499 I will not throw paper airplanes in class. 500 I will not throw paper airplanes in class. 501 Variable Count which is type integer

69 Rick Graziani graziani@cabrillo.edu69 Variables Variables are declared, defined in the declaration section of the program. –Usually at the beginning of the program –Examples: int height_in_inches char first_initial float price

70 Rick Graziani graziani@cabrillo.edu70 Variables Variables: –Can be given an initial value within the program –Value may change from: Program instructions User input Count 1 I will not throw paper airplanes in class. 2 3 … 499 I will not throw paper airplanes in class. 500 I will not throw paper airplanes in class. 501

71 Programming Concepts Count 123499500501 Variable Count which is type integer Count = 1 For Loop – As long as Count is less than or equal to 500 –Add 1 to Count –Print “I will not throw paper airplanes in class” Exit program

72 Software Development

73 Rick Graziani graziani@cabrillo.edu73 Definitions Software or Program Instructions that tell the computer what to do Programmer Someone who writes computer programs

74 Rick Graziani graziani@cabrillo.edu74 Instruction Set A vocabulary (list) of instructions which can be executed by the CPU The only instructions the CPU can run or execute Example of a CPU’s Instruction Set CPU Instruction Set

75 Rick Graziani graziani@cabrillo.edu75 First Generation Languages (Machine Language) Programming computers using the CPU’s instruction set Also known as Machine Language (timeline) Machine Code File A software file which contains the instructions from the CPU’s instruction set.

76 Rick Graziani graziani@cabrillo.edu76 Advantages of First Gen. Software programs execute (run) relatively very quickly Software programs are relatively small in size (Insignificant advantages today) Disadvantages of First Gen. Difficult to write, very detailed and takes a long time Difficult to read Difficult to debug debug = the process to find mistakes in a software program First Generation Languages (Machine Language)

77 Rick Graziani graziani@cabrillo.edu77 Second Generation Languages (Assembly Language) Assembly Language = The English-like instructions which are equivalent to the CPU’s instruction set Source Code= The actual instructions written by a programmer Compiler = Software which translates source code instructions of a particular language into machine code Op-code Description 1LOAD reg. R from cell XY. 2LOAD reg. R with XY. 3STORE reg. R at XY. 4MOVE R to S. 5ADD S and T into R. (2’s comp.) 6ADD S and T into R. (floating pt.) 7OR S and T into R. 8AND S and T into R. 9XOR S and T into R. AROTATE reg. R X times. BJUMP to XY if R = reg. 0. CHALT.

78 Rick Graziani graziani@cabrillo.edu78 Question: Which of these two files (source code file or machine code file) will the user need to run this software program? Advantages of Second Gen. Easier to read than first gen. Easier to write than first gen. Easier to debug than first gen. Disadvantages of Second Gen. Still very difficult to write programs Second Generation Languages (Assembly Language)

79 Rick Graziani graziani@cabrillo.edu79 Using a compiler

80 Rick Graziani graziani@cabrillo.edu80 Using an Interpreter

81 Interpreter versus Compiler Rick Graziani graziani@cabrillo.edu81

82 Rick Graziani graziani@cabrillo.edu82 Third Generation Languages (High level languages) Languages which are somewhere between machine language and the human language. FORTRAN (Formula Translation) - 1950's Language to allow scientists and engineers to program computers. COBOL (Common Business Oriented Language) - 1960 Language primarily designed for US government and defense contractors to program business applications on the computer. Grace Hopper was one of the developers of COBOL. BASIC (Beginner's All-purpose Symbolic Code) - 1960's Alternative language to FORTRAN for beginning programming students.

83 Rick Graziani graziani@cabrillo.edu83 Pascal (named after Blaise Pascal, 17th century French mathematician) - 1970's Language to teach proper structured programming. Structured programming = Programming technique used to make programming more productive and easier to write. Stresses simplistic, modular programs. ADA (named after Ada Lovelace (programmed the 19th century 'analytical engine') - late 1970's Language developed to replace COBOL. Third Generation Languages (High level languages)

84 Rick Graziani graziani@cabrillo.edu84 C (successor to BCPL or "B") - 1970's Popular programming language on computers from microcomputers to super computers. Faster and more efficient language. Very powerful language. Source code example of a C Program (Displays Hello World! on the screen.) #include main() { printf("Hello World!"); } C++ (pronounced "C plus plus") - 1980's Object oriented language which is compatible with C. JAVA Third Generation Languages (High level languages)

85 Rick Graziani graziani@cabrillo.edu85 Advantages Easier to read, write and debug Faster creation of programs Disadvantages Still not a tool for the average user to create software programs Requires very good knowledge of programming and of the language Third Generation Languages (High level languages)


Download ppt "Computer Programming CS 1 Introduction to Computers and Computer Technology Rick Graziani Fall 2015."

Similar presentations


Ads by Google