software development cs 1 rick graziani spring 2007

Post on 23-Dec-2015

217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Software Development

CS 1

Rick Graziani

Spring 2007

Rick Graziani graziani@cabrillo.edu 2

Definitions

Software or Program

Instructions that tell the computer what to do

Programmer

Someone who writes computer programs

Rick Graziani graziani@cabrillo.edu 3

Instruction SetA 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

Instruction Set Instruction0001 Move0010 Compare0011 Bit test0100 Bit clear0101 Bit set0110 Add0111 See group 101000 See groups 11, 13, 141001 Move byte

Rick Graziani graziani@cabrillo.edu 4

First Generation Languages(Machine Language)

• Programming computers using the CPU’s instruction set• Also known as Machine Language

Machine Code FileA software file which contains the instructions from the CPU’s

instruction set.

Rick Graziani graziani@cabrillo.edu 5

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)

Rick Graziani graziani@cabrillo.edu 6

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

Instruction Set Instruction0001 Move0010 Compare0011 Bit test0100 Bit clear0101 Bit set0110 Add0111 See group 101000 See groups 11, 13, 141001 Move byte

Rick Graziani graziani@cabrillo.edu 7

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)

Rick Graziani graziani@cabrillo.edu 8

Using a compiler

Rick Graziani graziani@cabrillo.edu 9

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.

Rick Graziani graziani@cabrillo.edu 10

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)

Rick Graziani graziani@cabrillo.edu 11

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 <stdio.h>

main()

{

printf("Hello World!");

}

C++ (pronounced "C plus plus") - 1980's

Object oriented language which is compatible with C.

Third Generation Languages(High level languages)

Rick Graziani graziani@cabrillo.edu 12

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)

Rick Graziani graziani@cabrillo.edu 13

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)

Rick Graziani graziani@cabrillo.edu 14

Writing a Software Program

Steps in writing a software program

1. Hardware (CPU)

2. Operating System

3. Programming Language

4. Brand of Compiler

5. Writing the Program

Rick Graziani graziani@cabrillo.edu 15

Task

Write a program to convert binary numbers to decimal and decimal numbers to binary

Writing a Software Program

Rick Graziani graziani@cabrillo.edu 16

1. Determine what kind of computer you want your program to run on

Macintosh?

Windows PC?

Mainframe?

Writing a Software Program

Rick Graziani graziani@cabrillo.edu 17

2. Determine which operating system this computer (and the user) will be using

Windows XP?

Mac OSX?

Linux?

Writing a Software Program

Rick Graziani graziani@cabrillo.edu 18

3. Determine which language you will be programming in.

C?

C++?

Java?

• C++

Writing a Software Program

Rick Graziani graziani@cabrillo.edu 19

4. Determine the compiler for your language, operating system and hardware

Microsoft Visual C++?

Borland C++?

Watkins C++?

• Microsoft Visual C++

Writing a Software Program

Rick Graziani graziani@cabrillo.edu 20

5. Write the program

Writing a Software Program

Rick Graziani graziani@cabrillo.edu 21

Compile the program into a machine code file and distribute it to the users via floppy diskette.

Writing a Software Program

Rick Graziani graziani@cabrillo.edu 22

Fourth Generation Languages

Languages which are more like natural human languages

• uses English phrases

• common with data base languages

search for name equals “graziani” and state equals “ca”

Examples

dBase FoxPro Access

Oracle Informix SQL

Rick Graziani graziani@cabrillo.edu 23

Fourth Generation Languages

Advantages• Average users can quickly learn to “query” the

database• Average users can easily learn how to write

programs• Programs are written faster

Disadvantages• Can not write sophisticate programs like word

processors, graphics, etc.• Mostly for data base applications like phone

information.

Rick Graziani graziani@cabrillo.edu 24

The Year 2000What is the big deal?

Older computer systems

• limited RAM memory

• limited disk storage

• slower processors (CPUs)

The YEAR was stored using two bytes instead of four bytes, in order to save bytes in RAM and storage

• 67 instead of 1967

Rick Graziani graziani@cabrillo.edu 25

Example:• 500,000 records

Save 1 million bytes 500,000 x 4 bytes (19xx) = 2 million bytes 500,000 x 2 bytes (xx) = 1 million bytes

• less storage on disk• less RAM memory needed• faster processing

The Year 2000What is the big deal?

Rick Graziani graziani@cabrillo.edu 26

Problem

The year 2000 will be “00” or looked at by the computers as the year “1900”

Will cause miscalculations for everything from pension funds to horoscopes.

The Year 2000What is the big deal?

Databases and Relationships

Rick Graziani graziani@cabrillo.edu 28

Relationships

• One-to-One

• One-to-Many

• Many-to-Many

Rick Graziani graziani@cabrillo.edu 29

One-to-One Relationships

Rick Graziani graziani@cabrillo.edu 30

One-to-Many Relationships

Rick Graziani graziani@cabrillo.edu 31

One-to-Many Relationships

Rick Graziani graziani@cabrillo.edu 32

Many-to-Many Relationships

(Not recommended)

Software Development

CS 1

Rick Graziani

Spring 2007

top related