Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
CSE 1340CSE 1340Introduction to Computing ConceptsIntroduction to Computing Concepts Class 2 Class 2
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Review of course requirements:Review of course requirements:
Homework due Tuesday at beginning of class-- no lates accepted
Programming assignments due during lab hour or at the latest, 5pm the next day
Student’s responsibility to have work turned in on-time or early. Programs and their associated files must be uploaded to Blackboard by the due date/time
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Review of course requirements:Review of course requirements:
Review of course requirements:– Incentives for coming to class lecture
on Tuesdays and Thursdays • Unannounced quizzes• Unannounced fun logical quizzes and
bonus opportunities given for getting back points lost on turned in homework assignmentfor that week
• Interactive Class notes distributed
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Review of course requirements:Review of course requirements:Must enroll in a labLab sessions are mandatoryPop Quizzes cannot be made upHomework cannot be made upPrograms can be turned in late BUT
only 1 day late; no late points assessedMake-up exams only given if
documented excuse has been submitted BEFORE exam
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
CommunicationCommunicationOffice hoursvia email:
– Please identify yourselfBlackboard address
– http://courses.smu.edu (use your 8 digit smu id for your userid and password)
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Synchronization of passwordsSynchronization of passwordsYou can change your password in
Blackboard by going to your homepage and clicking on “change password” in the upper right-hand corner of the window.
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Class 02 objectivesClass 02 objectives List the basic components of a computer system Understand what a Computer Program is List the Programming Life-Cycle Phases Describe the characteristics of Java Explain the uses of Java and identify types of Java
programs.
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Computer Systems: Hardware and SoftwareComputer Systems: Hardware and Software
Hardware --- the equipment Software --- programs that run the equipment
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Computer Components-- Computer Components-- HardwareHardware
Arithmetic Logic Unit
Control Unit
Secondary (Auxiliary)
StorageDevice
Memory Unit ( RAM & Registers )
Central Processing Unit ( CPU ) Input Device
Output Device
Peripherals
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Memory UnitMemory Unit
is an ordered sequence of storage cells, each capable of holding a piece of information
each cell has its own unique address
the information held can be input data, computed values, or your program instructions.
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Central Processing UnitCentral Processing Unit
has 2 components to execute program instructions
– Arithmetic/Logic Unit performs arithmetic operations, and makes logical comparisons.
– Control Unit controls the order in which your program instructions are executed.
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
PeripheralsPeripherals
are input, output, or auxiliary storage devices attached to a computer
– Input Devices include keyboard and mouse.
– Output Devices include printers, video display, LCD screens.
– Auxiliary/Secondary Storage Devices include disk drives, scanners, CD-ROM and DVD-ROM drives, modems, sound cards, speakers, and digital cameras.
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
WHAT IS A PROGRAM?WHAT IS A PROGRAM?
A program is a step-by-step series of instructions for a computer
Computer programming is the process of writing these instructions
Programmers, or developers, design and write programs using a programming language or development tool
Java is a programming language that provides the structure for efficient and economical programs
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
1. Display a message on the screen asking “How many hours did you work?”2. Wait for the user to enter the hours. Once the user
enter the hours, store it in memory3. Display a message on the screen that asks “How
much do you get paid per hour?”4. Wait for the user to enter the rate of pay. Once
the user enters the rate, store it in memory5. Multiply hours by rate and store the result in
memory as gross pay6. Display the gross pay
A SET OF INSTRUCTIONS
Page 7
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Inside the Program
INPUTPROCESSING
OUTPUT
sum = sum + number;
number =keyboard.nextInt();
System.out.print(sum);
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
The Programming ProcessThe Programming Process Analyze the requirements
– Precisely define what problem is to be solved Design the solution
– flowchart – pseudocode
Validate the design Implement the design
– Code the program Test (debug) the solution (compile/run)
– Syntax errors– Logical errors
Document the program
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Program Development CycleProgram Development Cycle
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 1 – Analyze the RequirementsPhase 1 – Analyze the Requirements
Verify that the requirements are clear and complete
Evaluate the problem to determine that it is solvable using a program
List the required input and output data
Determine whether the input data is available for testing
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 1 – Analyze the RequirementsPhase 1 – Analyze the Requirements
Ensure that a solution, or algorithm, can be developed with the information provided in the requirements
Verify the user interface specifications
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Requirements Document
p. 13
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 2 – Design the SolutionPhase 2 – Design the Solution
Develop a logical model that illustrates the sequence of steps you will take to solve the problem
Use design tools such as storyboards, class diagrams, flowcharts, and pseudocode to outline the logic of the program
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 2 – Design the SolutionPhase 2 – Design the Solution
Storyboards are sketches of the user interface
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 2 – Design the SolutionPhase 2 – Design the Solution
Flowcharts graphically represent the logic used to develop an algorithm
Control structures allow the programmer to specify the code that will execute only if a condition is met
Flowcharts use pseudocode, English, or mathematical notation inside symbols to represent the steps of a solution
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Flowcharting symbols
p. 17
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 2 – Design the SolutionPhase 2 – Design the Solution
Pseudocode is an English representation of how the program code should be written
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 3 – Validate the DesignPhase 3 – Validate the Design
The programmer steps through the solution with test data
The user agrees that the program design solves the problem put forth in the requirements
The user verifies that the initial requirements document contains all necessary requirements
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 4 – Implement the DesignPhase 4 – Implement the Design
Write the code that translates the design into a program
Create the user interfaceCreate comments within the code that
explains the purpose of the codeUnit testing
– Test the code as it is writtenTest related code
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 4 – Implement the DesignPhase 4 – Implement the Design
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 5 – Test the SolutionPhase 5 – Test the SolutionCreate a test plan with test cases of
sample input data and expected output Perform integration testing to ensure
that components interact correctlyTest boundary valuesDocument any problems
– If results are unsatisfactory, a new iteration of the development cycle begins
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Phase 6 – Document the SolutionPhase 6 – Document the Solution
Requirements documents, program design documents, user interface documents, and documentation of the code
Test cases and proof of successful completion of testing
Program code should be archived electronically
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Programming languagesProgramming languages
A special language used to write computer instructions consisting of– Key Words
• Words that have a special meaning• Can only be used for their inteded
purpose.– Programmer-Defined Symbols
• Words or names defined by the programmer
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
– Operators
• Operators perform operations on one or more operands(a piece of data)
– Punctuation
• Punctuation characters that mark the beginning of a statement, or separate items in a list
– Syntax
• Rules that must be followed when constructing a program
Cla
ss 2
~ C
hap
ter
1C
lass
2 ~
Ch
apte
r 1
Conclusion of Class 2Conclusion of Class 2