1/70
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Hardware and Software
the two majors components of any computer system
Hardware
equipment, or devices (tangible parts)
Software
programs that contain instructions for the computer
Four major operations in a computer
Input
Processing
Output
Storage
Input devices
allow data to enter the computer
ex. Mouse, keyboard, scanner
Central Processing Unit (CPU)
hardware that performs the tasks
Output devices
provide data to the user
ex. Printer, monitor, speaker
Programming language
special language containing instructions for the computer
ex. Visual Basic, Java, C#, C++, COBOl
Syntax
rules governing word usage and punctuation in the language
Machine Language
controls the computer's on/off cicuitry
Compiler or interpreter
software that translates programming languages to machine language
Understand the problem
May be the most difficult phase
Users may not be able to articulate their needs well
User needs may be changing frequently
Programmers may have to learn the user's Functional job tasks
Plan the logic
Plan the steps that the program will take
Use tools such as flowcharts and pseudocode
Walk through the logic before coding by desk - checking the logic
Code the program
Select the programming language
Write the instructions
Planning generally more difficult than coding
Use software to translate the program to machine language
programmers write instructions in high-level languages that resemble a natural language
Compilers or interpreters
change the programs into a low-level machine language
Syntax errors
are identified by the compiler or interpreter
Test the program
Execute it with sample data and check results
Identify logic errors and correct them
Choose test data carefully to exercise all branches of the logic
Put the program into production
Might mean simply running the program once
Process might take months if program is used on regular basis or is part of larger development
Maintain the program
Maintenance
Common first programming job
Make changes to existing programs
Documentation
supporting paperwork for a program
Conversion
entire set of actions organization must take to switchover to new programs
Prompt
message displayed on a monitor
Asks the user for a response
Command prompt
location to type entries to communicate with the operating system
Graphical User Interface (GUI)
allows users to interact with a program in a graphical environment
Flowchart
A pictorial representation of the logic steps
Pseudocode
Natural language representation of the logic
English-like representation of the lo
Flowlines
Connect the steps
Show the sequence of statements
Have arrows to show the direction
Terminal symbol
Shows the start and end points of the statements
Oval
Start/end
Paralellogram
Input/Output
Rectangle
Process
Diamond
Decision
Infinite loop
a sequence of statements that repeats forever with no escape
avoid infinite loops by testing for a predetermined value that means "stop processing"
Decision
testing a value
Sentinel value
Does not represent real data
Signal to stop
Can be used with input from files or from users
End-of-file(EOF) marker
Code stored in the file that marks the end of the data
Usually used instead of a sentinel value for file input
Flowchart connector symbol
Marks a logic transfer to another location in the flowchart
Transfer location can be on the same page or on another page
On-page symbol
a circle with a number or letter to identify the matching transfer location
Off-page symbol
a square with pointed bottom, containing page number and a number of letter to identify the matching transfer location (banner symbol)
Variable
A memory location whose contents vary; also called an identifier
Text
stored by string, text, or character variables
Numeric
stored by numeric variables
Constants
Values that do not change while the program is running
Have identifiers, and can be used like variables for calculations, but cannot be assigned new values
Integer
Whole numbers only
Floating-point
fractional numeric values with decimal points
Procedural programming
focuses on the procedures that programmers create
Object-oriented programming
focuses on objects that represent real-word things and their attributes and behaviors
Data Items
All the text, numbers, and other information that are processed by a computer
Stored in variables memory
Declaration
Statement that provides a data type and an identifier for a variable
Identifier
Variable's name
Garbage
Variable's unknown value before initialization
Camel casing
Variables names such as hourlyWage have a "hump" in the middle
Magic number
Unnamed constant
Purpose is not immediately apparent
Avoid this
Spaghetti code
Snarled program logic
Sequence
Perform actions in order
No branching or skipping any task
Selection (decision)
Ask a question, take one of two actions
Dual-alternative or single-alternative ifs
Loop
Repeat actions based on answer to a question
Priming read (or priming input)
Reads the first input data record
Outside the loop that reads the rest of the records
Helps keep the program structured
Dual-alternative (or binary) selection structure
Provides an action for each of two possible outcomes
Single-alternative (or unary) selection structure
Action is provided for only one outcome
if-then
if-then clause
Holds the action or actions that execute when the tested condition in the decision is true
else clause
Executes only when the tested condition in the decision is false
Compound condition
Asks multiple questions before an outcome is determined
AND decision
Requires that both of two tests evaluate to true
Requires a nested decision (nested if) or a cascading if statement
Conditional AND operator
Ask two or more questions in a single comparison
Each Boolean expression must be true for entire expression to evaluate to true
Truth tables
Describe the truth of an entire expression based on the truth of its parts
Short-circuit evaluation
Expression evaluated only as far as necessary to determine truth
OR decision
Take action when one or the other of two conditions is true
Conditional OR operator
Ask two or more questions in a single comparison
Only one Boolean expression in an OR selection must be true to produce a result of true
Range check
Compare a variable to a series of values between limits
Use the lowest or highest value in each range
Adjust the question logic when using highest versus lowest values