Documente Academic
Documente Profesional
Documente Cultură
ES 26 Introduction to Computer Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
1
Solamo ver 1.1
Objectives
Describe what programmers DO and DON'T DO Explain how programmers define a problem, plan the solution, and then code, test, and document the program List and describe the levels of programming languages: machine, assembly, high level, very high level, and natural Introduce the Java Language
ES 26 Introduction to Computer Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
2
Solamo ver 1.1
Programming Terminologies
Program
is a set of detailed, step-by-step instructions that directs the computer to do what you want it to do is a set of rules that provides a way of telling the computer what operations to perform
Programming language
ES 26 Introduction to Computer Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
3
Solamo ver 1.1
Defining the problem Planning the solution Coding the program Testing the program Documenting the program
ES 26 Introduction to Computer Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
4
Solamo ver 1.1
The objects (and classes) that are part of the project or problem domain The properties (and attributes) of the identified objects The responsibility (or operations) of the identified objects The relationships (or collaborations) of the identified objects The scenarios of how the objects interact with one another
Return ES 26 Introduction to Computer Programming Source: A Recipe for Object-oriented Design (http://max.cs.kzoo.edu/AP/OOD/OODPresentation) Lesson 03- Getting to Know the Environment 5 Lesson 02- Problem-solving in a Computer Solamo ver 1.1
Algorithm
Carry out each step of the algorithm with pencil and paper
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
6
Solamo ver 1.1
Planning Tools
Class Diagram
ES 26 Introduction to Computer Next Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
7
Solamo ver 1.1
Planning Tools
Flowchart
ES 26 Introduction to Computer Next Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
8
Solamo ver 1.1
Planning Tools
Translating the class from the planning stage into a formal programming language All languages have syntax rules
Similar to grammatical rules The computer will reject a program with even a minor syntax error
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
10
Solamo ver 1.1
Translation
Converting the program you wrote into the binary instructions the CPU understands Identifying and correcting logic errors in the program
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
11
Solamo ver 1.1
Translation
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
12
Solamo ver 1.1
Materials are generated at each part of the process Common examples of documentation
Flowchart and/or pseudocode Comments within the source code (using javadocs) Testing procedures Layouts of input and output records A narrative description of the program
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
13
Solamo ver 1.1
Levels of Languages
Lower-level languages
more like the 0s and 1s the computer itself uses more like the languages people use Divided into five generations
Higher-level languages
ES 26 Introduction to Computer Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
14
Solamo ver 1.1
Machine language Assembly languages High-level languages Very high-level languages Natural languages
ES 26 Introduction to Computer Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
15
Solamo ver 1.1
Machine Language
Programs and memory locations are written in strings of 0s and 1s Problems with machine languages
Programs are difficult to write and debug Each computer has its own machine language
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
16
Solamo ver 1.1
Assembly Languages
For example, A for add, C for compare, etc. Use names rather than binary addresses for memory locations
Require an assembler to translate the program into machine language Still used for programming chips and writing utility programs
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
17
Solamo ver 1.1
High-Level Languages
Transformed programming
Programmers could focus on solving problems rather than manipulating hardware Programs could be written and debugged much more quickly
Each computer has its own version of a compiler for each language
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
18
Solamo ver 1.1
The programmer specifies the desired results, and the language develops the solution Programmers can be about 10 times more productive using a fourth-generation language than a third-generation language
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
19
Solamo ver 1.1
Natural Languages
Programs can be written in a natural syntax, rather than in the syntax rules of a programming language
The language translates the instructions into code the computer can execute
ES 26 Introduction to Computer Return Programming Lesson 03- Getting to Know the Environment Lesson 02- Problem-solving in a Computer
20
Solamo ver 1.1