algorithmic concepts infsy 307 class notes

22
Algorithmic Algorithmic Concepts Concepts INFSY 307 INFSY 307 Class Notes Class Notes School of Business School of Business Administration Administration Penn State Harrisburg Penn State Harrisburg Spring 2003 Spring 2003

Upload: unity-pope

Post on 03-Jan-2016

39 views

Category:

Documents


3 download

DESCRIPTION

Algorithmic Concepts INFSY 307 Class Notes. School of Business Administration Penn State Harrisburg Spring 2003. INTRODUCTION. Course Syllabus Found on Angel at cms.psu.edu Instructor. Computer Systems. Hardware physical machines Software collection of programs Program - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Algorithmic Concepts INFSY 307 Class Notes

Algorithmic ConceptsAlgorithmic ConceptsINFSY 307INFSY 307Class NotesClass Notes

School of Business AdministrationSchool of Business Administration

Penn State HarrisburgPenn State Harrisburg

Spring 2003Spring 2003

Page 2: Algorithmic Concepts INFSY 307 Class Notes

INTRODUCTIONINTRODUCTION

Course SyllabusCourse Syllabus– Found on Angel at cms.psu.eduFound on Angel at cms.psu.edu

InstructorInstructor

Page 3: Algorithmic Concepts INFSY 307 Class Notes

Computer SystemsComputer SystemsComputer SystemsComputer Systems

HardwareHardware– physical machinesphysical machines

SoftwareSoftware– collection of programscollection of programs

ProgramProgram– a set of instructions for a computer to followa set of instructions for a computer to follow

Page 4: Algorithmic Concepts INFSY 307 Class Notes

HardwareHardwareHardwareHardware

Classes of computersClasses of computers– MicrocomputersMicrocomputers– MainframesMainframes

Network - any number of computers Network - any number of computers connected to share resourcesconnected to share resources

Page 5: Algorithmic Concepts INFSY 307 Class Notes

HardwareHardwareHardwareHardware

Tower box

Monitor

Keyboard Mouse

Printer

Diskettes

Input Devices

Central Processing UnitMain Memory

Secondary Memory

Output Devices

Page 6: Algorithmic Concepts INFSY 307 Class Notes

HardwareHardwareHardwareHardware

Main Memory/RAMMain Memory/RAM– numbered location (P.O. boxes) called numbered location (P.O. boxes) called

addressaddress– where computer places instructions or data where computer places instructions or data

during operationduring operation– information is stored in binary (information is stored in binary (11’s and ’s and 00’s)’s)– one digit with a value of 1 or 0 is called a one digit with a value of 1 or 0 is called a

binary digitbinary digit or a or a bitbit– eight bits in memory is called a eight bits in memory is called a bytebyte

Page 7: Algorithmic Concepts INFSY 307 Class Notes

memory/RAM

Central Processing Unit(CPU)

Page 8: Algorithmic Concepts INFSY 307 Class Notes

=> 4

00110100

Byte = a memory location

0 0 1 1 0 1 0 0

52

memory

4ASCIICharacter

The numberon thekeyboard youtype.

Binary isstored inmemory

Page 9: Algorithmic Concepts INFSY 307 Class Notes

ReviewReview

Information is represented as __’s and __’s?Information is represented as __’s and __’s?

Associated with the above is a memory Associated with the above is a memory location or ________?location or ________?

Each memory location is further divided into Each memory location is further divided into ________?________?

Characters are represented in ________ Characters are represented in ________ format.format.

Page 10: Algorithmic Concepts INFSY 307 Class Notes

HardwareHardwareHardwareHardware

Secondary MemorySecondary Memory– used to keep permanent recordsused to keep permanent records– a.k.a. secondary storage, auxiliary memory, a.k.a. secondary storage, auxiliary memory,

auxiliary storage, external memory, external auxiliary storage, external memory, external storagestorage

– filesfiles– hard disks, diskettes, tape drives, CD-ROMhard disks, diskettes, tape drives, CD-ROM

Page 11: Algorithmic Concepts INFSY 307 Class Notes

HardwareHardwareHardwareHardware

Central Processing Unit (CPU)Central Processing Unit (CPU)– coordinates computer operationscoordinates computer operations– executes instructions in a programexecutes instructions in a program– add, subtract, multiply, divide accomplished add, subtract, multiply, divide accomplished

by the Arithmetic and logic unit (ALU)by the Arithmetic and logic unit (ALU)– move items from one memory location to move items from one memory location to

anotheranother

Page 12: Algorithmic Concepts INFSY 307 Class Notes

SoftwareSoftwareSoftwareSoftware

Operating SystemOperating System– directs computer’s resources to different directs computer’s resources to different

taskstasks– UNIX, Linux, MacOS, MVS, Solaris, UNIX, Linux, MacOS, MVS, Solaris,

Microsoft XPMicrosoft XP

ProgramProgram– set of instructions for computerset of instructions for computer

Page 13: Algorithmic Concepts INFSY 307 Class Notes

High-Level LanguagesHigh-Level LanguagesHigh-Level LanguagesHigh-Level Languages

Resemble human languages, i.e. easy Resemble human languages, i.e. easy for humans to readfor humans to read– C++, COBOL, FORTRAN, LispC++, COBOL, FORTRAN, Lisp– contain complicated instructionscontain complicated instructions

Low-level LanguagesLow-level Languages– AssemblerAssembler– one instruction causes one actionone instruction causes one action

Machine Language - ones and zerosMachine Language - ones and zeros

Page 14: Algorithmic Concepts INFSY 307 Class Notes

CompilersCompilersCompilersCompilers

Program that translates high-level Program that translates high-level language into machine-languagelanguage into machine-language

Input program written by programmer = Input program written by programmer = Source ProgramSource Program or or Source CodeSource Code

Output program translated by the Output program translated by the compiler = compiler = Object ProgramObject Program or or Object Object CodeCode

Page 15: Algorithmic Concepts INFSY 307 Class Notes

CompilerCompilerCompilerCompiler

ComputerCompiler

ObjectCode

C++ Program

Objectcode for

otherroutines

Linker

Machine LanguageCode ready to run

Page 16: Algorithmic Concepts INFSY 307 Class Notes

Monitor

Central Processing Unit(CPU)

Operating System

Compiler

Program

Data

Page 17: Algorithmic Concepts INFSY 307 Class Notes

ReviewReview

What program is in charge of the system What program is in charge of the system environment?environment?

What program integrates object code What program integrates object code with system software resources?with system software resources?

What program is data to the compiler What program is data to the compiler program?program?

Page 18: Algorithmic Concepts INFSY 307 Class Notes

Software Development Software Development MethodMethod

1.1. Specify the problem requirements.Specify the problem requirements.

2.2. Analyze the problem.Analyze the problem.

3.3. Design the algorithm to solve the Design the algorithm to solve the problem.problem.

4.4. Implement the algorithm.Implement the algorithm.

5.5. Test and verify the completed program.Test and verify the completed program.

6.6. Maintain and update the program.Maintain and update the program.

Page 19: Algorithmic Concepts INFSY 307 Class Notes

AlgorithmsAlgorithmsAlgorithmsAlgorithms

A sequence of precise instructions which A sequence of precise instructions which leads to a solutionleads to a solution

Most difficult part of solving a problem on Most difficult part of solving a problem on a computer is discovering “the method of a computer is discovering “the method of solution”solution”

A computer program is simply an A computer program is simply an algorithm expressed in a language the algorithm expressed in a language the computer understands.computer understands.

Page 20: Algorithmic Concepts INFSY 307 Class Notes

Algorithm that determines how many Algorithm that determines how many apples are in an orchard.apples are in an orchard.

Algorithm that determines how many Algorithm that determines how many apples are in an orchard.apples are in an orchard.

1 Determine how many apple trees are in the Determine how many apple trees are in the orchard approximately.orchard approximately.

2 Estimate the number of apples growing on each Estimate the number of apples growing on each tree.tree.

3 Multiply the number of apple trees times the Multiply the number of apple trees times the number of apples on each tree.number of apples on each tree.

4 Display the answer.Display the answer.

Page 21: Algorithmic Concepts INFSY 307 Class Notes

Program DesignProgram Design

Understand the programrequirements

What are the inputs/outputs?

Write and test your algorithm

Write and test yourprogram

Page 22: Algorithmic Concepts INFSY 307 Class Notes

Ethics for Computer ProgrammersEthics for Computer Programmers

Privacy and misuse of dataPrivacy and misuse of data

Computer hackingComputer hacking

Plagiarism and software piracyPlagiarism and software piracy

Misuse of a computer resourceMisuse of a computer resource