Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
77 Cards in this Set
- Front
- Back
Common characteristics for problems & how to solve
|
There is an initial statement defining the problem...There is a goal to be reached...The path to the goal usually requires several steps...We may solve the problems by carrying out a series of steps that take us from the initial state to the goal state.
|
|
The States of Problem Solving
|
Initial state, mental activity, intermediate states & goal state
|
|
Initial state (1)
|
Problem solving starts with a given initial situation
|
|
Mental Activity (2)
|
Based on the problem situation and your prior knowledge, you work towards a solution... this is the act of you trying to find a solution in your head
|
|
Intermediate States (3)
|
On the way from the initial state to the goal state, one passes through a number of other states as they are trying to find a solution. All other states apply to this category.
|
|
Goal state (4)
|
The solution has been reached!
|
|
Well defined problems
|
A problem that has all the necessary info in order to implement a plan of action to fix the problem at hand with whatever means or strategies necessary
|
|
Ill defined problems
|
Problems requiring us to gather more info in order to understand what the problem is or how to reach a solution
|
|
Information gathering
|
Gathering further info, making a problem well defined, in order to properly solve the problem.
|
|
2 Major Activities to Problem Solving
|
- ANALYSIS/PLANNING: to design the steps needed to solve the problem
- IMPLEMENTATION:to execute the steps needed in order to arrive at a solution |
|
What is Problem Solving?
|
"Solving a problem is finding a way out of a difficulty, a way around an obstacle, attaining an aim which was not immediately attainable." - George Polya
|
|
What is Problem Solving with Computers?
|
... To utilize a computer for solving problems, that is, to use the special characteristics od computers to help us reach a solution
|
|
Computer Characteristics (why computers can help to solve probs)
|
-Speed
-Accuracy -Consistency -Indefatigable |
|
What are Programs? How can they help?
|
A program is a set of instructions that may be executed by a computer. It's also that part of a computer system that provides humans with solutions to certain kinds of probs. ex: Visio, Word, Norton, etc.
|
|
IDE
|
Integrated Development Environment, a program that integrates several components that are needed by programmers to develop software. Like a source code editor, debugger, compiler or interpreter or a run-time system
|
|
Application software
|
Programs directly used by end users to solve problems
|
|
System software
|
Programs that support the fundamental operation of the computer, used as maintenance or used to create a program
|
|
What kinds of problems are solvable by computers?
|
Those for which there is a program available to solve them, or those for which we may effectively create a program to solve them
|
|
Excel
|
managing spreadsheets
|
|
Visio
|
used for drawing diagrams of different types
|
|
Step by Step is the Key
|
To solve probs, w/ computers through app. or sys. software, we need to create a series of steps that will lead us from an initial prob state to the goal state or solution
|
|
Algorithmic Problems
|
are problems that have a guaranteed solution that may be reached with a series of steps. ex: Alphabetize the list of 20,000 customers.
|
|
Heuristic Problems
|
are problems for which there are guidelines for arriving at possible solutions and for which there are no series of steps to arrive at a guaranteed solution...ex: Compose a beautiful song, or ask yourself "Should I sell my stock?"
|
|
Computer
|
...is a machine that transforms raw data into meaningful info
|
|
Where is a program when running?
|
Programs are in main memory (RAM) when they are executing and stored on the hard disk (usually) for permanent storage.
|
|
How does a program run?
|
User enters command to run program. OS locates program on auxiliary storage and loads it into RAM. Then, instructions of program are fed into CPU for execution.
|
|
CPU
|
Central Processing Unit, brain of the computer... the hardware component of the computer that follows programs' instructions and executes
|
|
RAM
|
Random Access Memory, temporary storage
|
|
Hard Disk
|
Auxiliary storage, permanent storage for data
|
|
How to create a program
|
You need to design the steps needed to solve the identified problem. (This is called the algorithm) Then, you need to convert the algorithm into instructions coded into a computer language
|
|
What is an algorithm?
|
A precise set of steps that describe exactly the tasks to be performed and their order for producing a specified result.
|
|
Steps for creating an algorithm
|
1. Define the problem.
- make sure you have a well defined statement that you thoroughly understand. Take part in info gathering until you fully get it. 2. Establish a solution outline - Create a rough draft of the solution by breaking it down into small steps/tasks 3. Develop the algorithm - expand the outline into the precise steps that describe exactly the tasks to be performed and their order of operation |
|
When a problem seems confusing or ambiguous...
|
- Re-read the problem statement
- Read appropriate material in the text - Do a Google search - Ask other students, instructors, etc for clarity |
|
To load a program
|
Transferring from auxiliary storage to ram by user entering a command
|
|
To run a program
|
Instructions In program fed to CPU for execution enabling program to run.
|
|
Pseudocode
|
A way to represent an algorithm through English type code based on high level programming languages
|
|
Flowcharts
|
A graphical way to represent an algorithm
|
|
Implementing the algorithm
|
Converting the steps to a specific computer language
|
|
Program code
|
The group of instructions created by the programmer
|
|
Coding
|
The act of writing the computer instructions in order to solve the prob
|
|
Computer Language
|
a language designed to be understood by a computer. An artificial language used to communicate with machine.
|
|
Source code
|
The instructions written by the programmer
|
|
Machine code
|
The language of the CPU; 0's and 1's
|
|
Compiler / interpreter
|
... is what translates the source code of a program language into machine code so the CPU can understand it
|
|
Input
|
Data flowing into a program, usually from an end-user
|
|
Output
|
Data flowing out of a program, the "end result"
|
|
Processing
|
The tasks and steps that the program must perform in order to get the correct output
|
|
Prompt
|
Requiring more information, you use prompt to retrieve that information from end user
|
|
Syntax
|
Refers to rules for constructing statements in languages
|
|
Delimiter
|
Characters (like +) that let the interpreter know where the beginning and the end of a string of characters is.
|
|
Variable
|
Named storage locations in RAM that are reserved for a programs use. Can store values and can be updated
|
|
How much detail?
|
The program that implements an algorithm will have the same level of detail as the algorithm (recall that the algorithm is the solution represented in a generic language)
|
|
What is programming?
|
Telling the computer how to do something. Breaking tasks down into smaller tasks over and over until you arrive at the task your comp already knows how to execute
|
|
Variable allocation
|
When a variable name is first used, it is allocated into RAM. A special place for storage is set for the var.
|
|
Variable attributes
|
Three properties of variables are set by the programmer in most programming languages: name, size, & data type.
|
|
Assignment statement
|
Assigns a value to a variable
|
|
Assignment operator
|
"="
|
|
Append
|
Combines something, through the symbol +, fusing a value to a string of characters.
|
|
Small Basic: Object
|
an entity that the program performs actions on like the TextWindow or a File.
|
|
Small Basic: Operation
|
actions performed on associated objects like WriteLine for outputting to the TextWindow. (like method in JS)
|
|
Small Basic: Property
|
characteristics of an object like foreground or background color for the TextWindow.
|
|
Small Basic: Variable
|
a storage location in RAM defined by the program
|
|
Small Basic: Keyword
|
reserved identifier for performing special actions like If or For
|
|
Small Basic: Syntax Basics
|
SB statements usually start w/ an object, keyword OR a variable.
An object normally is followed by an operation or property. |
|
Small Basic: "."
|
The "." seperator char. between an object and an operation or property associates the object with the following operation of property. It connects the two!
|
|
Small Basic: Syntax Operations
|
Operations are followed by parantheses *inside* . This is the input value for the operation or the *argument* of the operation. In the code, TextWindow.WriteLine("Hello World!") <---- the "Hello World" is the argument
|
|
Small Basic: Syntax Properties
|
Properties of an object are set by using the assignment operator, "=", followed by the value the programmer wants to set for that property <----- ex: TextWindow.ForegroundColor="Yellow"
|
|
Small Basic Color Codes
|
Green = object
Dark brown = operation / property Black = variable Light brown = data ( literals ) Light blue = keyword |
|
Program Development Steps
|
1. Define the problem
2. Develop the solution algorithm 3. Test the algorithm 4. Implement the algorithm 5. Document and maintain the program |
|
Prog. Dev. Steps 1) Define Problem
|
1. Define the problem.
Do as much Information Gathering as needed. Make sure you understand the issue at hand and have an idea of whats causing the problem before you jump into figuring out how to fix it. Use an IPO chart to divide the problem into three categories: input, processing, output. This can make the matter at hand much less daunting and unsolvable. |
|
Prog. Dev. Steps 2) Develop the solution algorithm
|
A) Outline the solution, when needed
- make a rough draft of the solution - decompose the prob into smaller steps - outline may include processing steps, subtasks, variables, control structures and main logic. B) Expand outline into the algorithm - a precise set of steps - should have the same level of detail as a written program was (this will help you prepare to turn it from pseudocode INTO code later on!) |
|
Prog. Dev. Steps 3) Test the algorithm
|
Must make sure algorithm is correct, so... we want to do a desk check before writing our code. It's the perfect time to detect & fix all logic errors at this point in the process.
|
|
Prog. Dev. Steps 4) Implement the algorithm
|
A) Code the program in your desired computer language, changing each algorithm step into a program command.
B) Once finished, run the program to check for errors and see if it works or not. |
|
Prog. Dev. Steps 5) Document and Maintain the Program
|
Try to have written information about what the programs supposed to do and how it does it.
Documentation should be an ongoing thing. Involving: -External documentation: outside the program -Internal documentation: inside the program (ex: comments tags in Javascript) -Maitenance (make appropr. changes to the program over time as needed) |
|
Syntax Errors
|
Those not conforming to the rules of the programming language, that are detected by the compiler/interpreter.
|
|
Logic Errors
|
Those not conforming to the requirements of the problem at hand. These errors can be detected at runtime.
|
|
Desk checking
|
Running the processing steps of the algorithm stage by stage, pretending you're the computer and looking for any errors in your logic or code.Keeping track of your variables on paper.
You should choose at least two sets of input test data, establish the results for each, & check the algorithm against the test data to confirm that it yields the expected results. |