Introduction to Com puters and Program ming O bjectives Com puters Being able to : D istinguish hardw are from softw are Identify m ain com ponentsofa com puter D efine the generalfunction ofeach part Program m ing Being able to : Recognize program m ing asonly a partofthe processofdeveloping a solution to a problem . Analysis . D esign . Implementation . Testing U nderstand the stepsin com piling and executing aprogram Relate the processofcom piling and executing to the hardware and softw are com ponentsused in each step.
24
Embed
Main Memory Central Processor Unit Keyboard Input Device Secondary Memory Monitor Printer Output Devices.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Introduction toComputers and Programming
ObjectivesComputers
Being able to : Distinguish hardware from software Identify main components of a computer Define the general function of each part
ProgrammingBeing able to : Recognize programming as only a part of the process of developing a
solution to a problem. Analysis. Design. Implementation. Testing
Understand the steps in compiling and executing a program Relate the process of compiling and executing to the hardware and
software components used in each step.
How much intelligence does a computer have?
LIKE A CALCULATOR!
If you were to solve the problem using a calculator, howmuch of the work would the calculator do for you?
NOT MUCH
Have you ever tried to explain a complicated process to aperson who you perceived to be slow to comprehend?
COMPUTERS ARE WORSE
Conclusion:As a programmer your job is to use the SIMPLE capabilities of a computer tosolve complicated problems.
It is not an easy task!
First Step:
Understand the Problem
How do you know if you understand?
Can you solve it by hand (with enough time)? 1. Create an example for which you know the answer. 2. Apply your approach 3. See if the answer looks right
It is like the scientific method 1. Propose a theory 2. Test the theory 3. If the example appears to disprove the theorem (shows your
approach is not correct), then modify your theory(approach) andtry again!
Remember!You have to describe EVERY step in your approach.
Second Step:Formulate (state) your solution
Third Step:Express the solution in a language
the computer can understand(c++ for us)
Fourth Step:Test your approach
As if it’s not hard enough, remember you are also using aNEW LANGUAGE to describe what to do!
Steps 1,3 and 4 are the easiest.Step 2 is very difficult!
Common Errors
1. Misunderstanding the problem
2. Having an error in your approach
3. Stating your approach incorrectly in c++
4. Typing wrong
Finding Errors
1. Look for the obvious first
2. Consider the kinds of mistakes you’ve made before(coaches and their players)
3. Isolate the parts of a system ( what if your stereo system fails)
Problem Solving
1. Look for solutions to similar problems and try to adapt thesolutions to your problem
2. A problem requiring a solution twice as long is four times ascomplicated
3. Use techniques we will show in class to manage the complexityof the problems
1. Be CAREFUL to avoid being ambiguous(saying something with multiple interpretations)
Examples:A person sitting at the desk is instructed to stand(we assume to turnfirst).
2. Be specific
Example:A parent tells the child, “You can’t have that candy”
Try to avoid being ambiguous and try to be specific.
3. Remember that ENGLISH is inherently ambiguous. You have been trainedto interpret in the proper context to eliminate ambiguity. Don’t ASSUME ina programming language. Programming languages are precise to avoid theseambiguities.