Presentation is loading. Please wait.

Presentation is loading. Please wait.

Welcome to CMPE003 Personal Computers: Hardware and Software Dr. Chane Fullmer Fall 2002 UC Santa Cruz.

Similar presentations


Presentation on theme: "Welcome to CMPE003 Personal Computers: Hardware and Software Dr. Chane Fullmer Fall 2002 UC Santa Cruz."— Presentation transcript:

1

2 Welcome to CMPE003 Personal Computers: Hardware and Software Dr. Chane Fullmer Fall 2002 UC Santa Cruz

3 November 22, 20022 Evaluation Time  Teaching evaluations  TA evaluations  Need a student volunteer –Monitor evaluation process –Return evaluations to the SOE office

4 November 22, 20023 Assignments  Assignment #6 – –The Last One –Due now  Must print out in color if you use color for the conditional in part #10 http://www.soe.ucsc.edu/classes/cmpe003/Fall02/hw6_spreadsheet.html

5 November 22, 20024 Class Information  Review for Midterm #3 –Monday November 25 –Don’t miss it for best results  No Chapter 17 on Midterm #3  No class meeting Wednesday, 11/27  Friday, Chapter 16 – last lecture  Last section is Tuesday, 11/26

6 November 22, 20025 Final Project  Due by December 3 rd, at beginning of final period –May be turned in earlier  Power Point Presentation –Min 4 pages – Max 6 –30% of grade based on your creativity Go crazy here… –Pts for video (of self ), music, animations, sounds –Pts for PPT tricks, styles, animations, buttons, etc.. –If you add animation or other special effects, include a floppy/CD with your printout –Emailed assignments will be rejected 

7 Programming Languages: Telling the Computers What to Do Chapter 16

8 November 22, 20027 Objectives  Describe what programmers do and do not do  Explain how programmers define a problem, plan the solution and then code, test, and document the program  List and describe the levels of programming languages – machine, assembly, high level, very high level, and natural  Describe the major programming languages in use today  Explain the concepts of object-oriented programming

9 November 22, 20028 Program Set of instructions written in a programming language that tells the computer what to do

10 November 22, 20029 Programmers  Prepare instructions that make up the program  Run the instructions to see if they produce the correct results  Make corrections  Document the program  Interact with –Users –Managers –Systems analysts  Coordinate with other programmers to build a complete system

11 November 22, 200210 The Programming Process  Defining the problem  Planning the solution  Coding the program  Testing the program  Documenting the program

12 November 22, 200211 The Programming Process Defining the Problem  What is the input  What output do you expect  How do you get from the input to the output

13 November 22, 200212 The Programming Process Planning the Solution  Algorithms –Detailed solutions to a given problem Sorting records, adding sums of numbers, etc..  Design tools –Flowchart –Pseudocode Has logic structure, but no command syntax  Desk-checking –Personal code design walk through  Structured walk through –“Code walk through” – peer reviewed

14 November 22, 200213 The Programming Process Planning the Solution Accept series of numbers and display the average

15 November 22, 200214 The Programming Process Coding the Program  Translate algorithm into a formal programming language  Within syntax of the language  How to key in the statements? –Text editor –Programming environment Interactive Development Environment (IDE)

16 November 22, 200215 The Programming Process Testing the Program  Translation – compiler –Translates from source module into object module –Detects syntax errors  Link – linkage editor (linker) –Combines object module with libraries to create load module –Finds undefined external references  Debugging –Run using data that tests all statements –Logic errors

17 November 22, 200216 The Programming Process Testing the Program

18 November 22, 200217 The Programming Process Documenting the Program  Performed throughout the development  Material generated during each step –Problem definitions –Program plan –Comments within source code –Testing procedures –Narrative –Layouts of input and output –Program listing

19 November 22, 200218 Choosing a Language  Choice made for you –What is available? –Required interface  What do you know best?  Which language lends itself to the problem to be solved?

20 November 22, 200219 Language Generations  Low levels closer to binary  High levels closer to human code  Five Generations: –Procedural Languages Machine language Assembly language High-level language – 3GL –Nonprocedural Languages Very high-level language – 4GL Natural language – 5GL

21 November 22, 200220 Machine Language  Written in strings of 0 and 1 –Displayed as hexadecimal  Only language the computer understands  All other programming languages are translated to machine language  Computer dependent

22 November 22, 200221 Assembly Language  Mnemonic codes –Add, sub, tst, jmp…  Names for memory locations  Computer dependent  Assembler translates from Assembly to machine language

23 November 22, 200222 3GL High-Level Languages  1960s  Languages designed for specific types of problems and used syntax familiar to the people in that field –FORTRAN: (FORmula TRANslator) Math –COBOL: (COmmon Business Oriented Language) Business  Compile translates from high-level language to machine language

24 November 22, 200223 4GL Very High-Level Languages  Programmer specifies the desired results; the language develops the solution  Ten times more productive with a 4GL than a procedural language  Query Languages –Retrieve information from databases –Easy to learn and use

25 November 22, 200224 5GL Natural Languages  Resemble natural or spoken English  Translates human instructions into code the computer can execute  Commonly used by non-programmers to access databases

26 November 22, 200225 Third Generation Languages Traditional Programming  Describe data  Describe procedures or operations on that data  Data and procedures are separate

27 November 22, 200226 Third Generation Languages  FORTRAN –1954 –Represent complex mathematical formulas –C/C++ has replaced FORTRAN  COBOL –1959 –Business –Large complex data files –Formatted business reports

28 November 22, 200227 Average a list of numbers Accept series of numbers and display the average

29 November 22, 200228 Third Generation Languages FORTRAN

30 November 22, 200229 Third Generation Languages COBOL

31 November 22, 200230 Third Generation Languages  BASIC (Beginners All-purpose Symbolic Instruction Code) –1965 –Popularity grew with PC popularity (1970s) –Easy to learn –Used little memory –Bill Gates beginnings.. M$ Basic  RPG –1965 –Report generation – quickly creates complex reports

32 November 22, 200231 Third Generation Languages BASIC

33 November 22, 200232 Third Generation Languages  M$ Visual Basic –1987 –Create complex user interfaces –Uses standard Windows features –Event-driven – user controls the program  C –1972 –Efficient code – the language of UNIX –Portability  C++ –Enhancement of C (Object Oriented)

34 November 22, 200233 Third Generation Languages C++

35 November 22, 200234 OOP Object-Oriented Programming  Object –Self-contained unit of data and instructions –Includes Related facts (data) Related functions (instructions to act on that data)  Example –Object:cat –Data:feet, nose, fur, tail –Functions:eat, purr, scratch, walk –Cat:Kitty, Tabby

36 November 22, 200235 OOP Object-Oriented Programming  Encapsulation – describes the objects self- containment  Attributes – the facts that describe the object  Methods / operations – the instructions that tell the object what to do  Instance – one occurrence of an object  Messages – activate methods –Polymorphism Example: A ‘walk’ message causes Kitty to move (in a cat-like way)

37 November 22, 200236 OOP Object-Oriented Programming  Class – defines characteristics unique to all objects of that class  Inheritance – Objects of a class automatically posses all of the characteristics of the class from which it was derived  Subclass – inherits characteristics from class and defines additional characteristics that are unique  Instance – actual occurrence of an object

38 November 22, 200237 OOP Object-Oriented Programming Example Class: Boat Subclass: Canoe Subclass: Powerboat Subclass: Sailboat Instance: Chardonnay II

39 November 22, 200238 OOP Object-Oriented Programming Using Objects in Business Class:Customer Subclass:Retail or Wholesale Instance: John Smith Retail and Wholesale customers automatically inherit customer address since it is part of the Customer class

40 November 22, 200239 OOP Object-Oriented Programming Languages  C++ Can write both structured and object-oriented code  Visual Basic Rudimentary features of object-oriented language

41 November 22, 200240 Third Generation Languages Java  Cross-platform  Java Virtual Machine (JVM) –Sits on top of computer’s regular platform –Translates compiled Java code into instructions for the specific platform  Applets

42 November 22, 200241 Learning to Program  Enroll in courses –Learn logic as well as language syntax  Read books, articles  Use tutorials  View Sample code  Write code (start small) –Enjoy

43 November 22, 200242


Download ppt "Welcome to CMPE003 Personal Computers: Hardware and Software Dr. Chane Fullmer Fall 2002 UC Santa Cruz."

Similar presentations


Ads by Google