Algorithmic Concepts INFSY 307 Class Notes
-
Upload
unity-pope -
Category
Documents
-
view
37 -
download
3
description
Transcript of 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
INTRODUCTIONINTRODUCTION
Course SyllabusCourse Syllabus– Found on Angel at cms.psu.eduFound on Angel at cms.psu.edu
InstructorInstructor
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
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
HardwareHardwareHardwareHardware
Tower box
Monitor
Keyboard Mouse
Printer
Diskettes
Input Devices
Central Processing UnitMain Memory
Secondary Memory
Output Devices
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
memory/RAM
Central Processing Unit(CPU)
=> 4
00110100
Byte = a memory location
0 0 1 1 0 1 0 0
52
memory
4ASCIICharacter
The numberon thekeyboard youtype.
Binary isstored inmemory
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.
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
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
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
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
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
CompilerCompilerCompilerCompiler
ComputerCompiler
ObjectCode
C++ Program
Objectcode for
otherroutines
Linker
Machine LanguageCode ready to run
Monitor
Central Processing Unit(CPU)
Operating System
Compiler
Program
Data
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?
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.
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.
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.
Program DesignProgram Design
Understand the programrequirements
What are the inputs/outputs?
Write and test your algorithm
Write and test yourprogram
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