+ All Categories
Home > Documents > Welcome to CMPE003 Personal Computer Concepts: Hardware and Software

Welcome to CMPE003 Personal Computer Concepts: Hardware and Software

Date post: 10-Jan-2016
Category:
Upload: quito
View: 21 times
Download: 0 times
Share this document with a friend
Description:
Welcome to CMPE003 Personal Computer Concepts: Hardware and Software. Winter 2003 UC Santa Cruz Instructor: Guy Cox. Assignments. Assignment #6 – DUE TODAY Due March 12, 2003 Spreadsheets – (MS Excel) Generate a monthly budget spreadsheet. Final Project. - PowerPoint PPT Presentation
Popular Tags:
40
Welcome to CMPE003 Personal Computer Concepts: Hardware and Software Winter 2003 UC Santa Cruz Instructor: Guy Cox
Transcript
Page 1: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

Welcome to CMPE003 Personal Computer Concepts: Hardware and Software

Winter 2003UC Santa Cruz

Instructor: Guy Cox

Page 2: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 2

Assignments

Assignment #6 – DUE TODAY Due March 12, 2003

Spreadsheets – (MS Excel) Generate a monthly budget spreadsheet

Page 3: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 3

Final Project

Due no later than March 19, 2003 You can turn in earlier..

Power Point presentation 4 pages Extra points for special effects, animations

Up load to your CATS account and write file location on your printout

http://www.soe.ucsc.edu/classes/cmpe003/Winter03/finalproject.html

Page 4: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

Programming Languages: Telling the Computers What to Do

Chapter 16

Page 5: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 5

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

Page 6: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 6

Program

Set of instructions written in a programming language that tells the computer what to do

Page 7: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 7

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

Page 8: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 8

The Programming Process

Defining the problem Planning the solution Coding the program Testing the program Documenting the program

Page 9: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 9

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

Page 10: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 10

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 Peer Reviews

“Code walk through”/structured walk through

Page 11: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 11

The Programming Process: Planning the Solution

Accept series of numbers and display the average

Page 12: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 12

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)

Page 13: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 13

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

Page 14: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 14

The Programming Process: Testing the Program

Page 15: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 15

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

Page 16: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 16

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?

Page 17: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 17

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

Page 18: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 18

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

Page 19: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 19

Assembly Language

Mnemonic codes Add, sub, tst, jmp…

Names for memory locations Computer dependent Assembler translates from Assembly to

machine language

Page 20: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 20

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

Page 21: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 21

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

Page 22: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 22

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

Page 23: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 23

Third Generation Languages: Traditional Programming

Describe data Describe procedures or operations on

that data Data and procedures are separate

Page 24: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 24

Third Generation Languages

FORTRAN 1954 Represent complex mathematical formulas C/C++ has replaced FORTRAN

COBOL 1959 Business Large complex data files Formatted business reports

Page 25: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 25

Average a list of numbers

Accept series of numbers and display the average

Page 26: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 26

Third Generation Languages

FORTRAN

Page 27: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 27

Third Generation Languages

COBOL

Page 28: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 28

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.. MS Basic

RPG 1965 Report generation – quickly creates complex

reports

Page 29: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 29

Third Generation Languages

BASIC

Page 30: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 30

Third Generation Languages MS 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)

Page 31: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 31

Third Generation Languages

C++

Page 32: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 32

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

Page 33: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 33

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)

Page 34: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 34

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

Page 35: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 35

ExampleClass: Boat

Subclass: Canoe

Subclass: Powerboat

Subclass: Sailboat

Instance: Chardonnay II

OOP: Object-Oriented Programming

Page 36: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 36

OOP: Object-Oriented Programming

Using Objects in BusinessClass: CustomerSubclass: Retail or WholesaleInstance: John Smith

Retail and Wholesale customers automatically inherit customer address since it is part of the Customer class

Page 37: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 37

OOP: Object-Oriented Programming

Languages C++

Can write both structured and object-oriented code Visual Basic

Rudimentary features of object-oriented language

Page 38: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 38

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

Page 39: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 39

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

Page 40: Welcome to CMPE003  Personal Computer Concepts: Hardware and Software

January 23, 2003 40


Recommended