Modul 9

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Programming Language

A collection of primitives along with a collection of rules stating how the primitives can be combined to represent more complex ideas constitutes a programming language.

A program

A program is a representation of an algorithm. (Here we are using the term algorithm in its less formal sense in that many programs are representations of nonterminating "algorithms.") In fact, within the computing community the term program usually refers to a formal representation of an algorithm designed for computer application.

Machine cycle algorithm

As long as the halt instruction has not been executed continue to execute the following steps: a. Fetch an instruction. b. Decode the instruction. c. Execute the instruction.

A primitive

Computer science approaches these problems by establishing a well-defined set of building blocks from which algorithm representations can be constructed. Such a building block is called a primitive.

Effective

Computer scientists use the term effective to capture the concept of being executable. That is, to say that a step is effective means that it is doable

Bottom-up methodology

In contrast, a bottom-up methodology progresses from the specific to the general.

Pseudocode

In general, a pseudocode is a notational system in which ideas can be expressed informally during the algorithm development process. A pseudocode must have a consistent, concise notation for representing recurring semantic structures.

Top-down methodology

In this light, stepwise refinement is a top-down methodology in that it progresses from the general to the specific.

Problem solving phases

Phase 1. Understand the problem. Phase 2. Devise a plan for solving the problem. Phase 3. Carry out the plan. Phase 4. Evaluate the solution for accuracy and for its potential as a tool for solving other problems. Translated into the context of program development, these phases become Phase 1. Understand the problem. Phase 2. Get an idea of how an algorithmic function might solve the problem. Phase 3. Formulate the algorithm and represent it as a program. Phase 4. Evaluate the program for accuracy and for its potential as a tool for solving other problems.

Terminating Process

The definition in Figure 5.1 also requires that an algorithm define a terminating process, which means that the execution of an algorithm must lead to an end 5.1 = An algorithm is an ordered set of unambiguous, exectuable steps that defines a terminating process.

Function and def

We will follow Python convention, using the term function for our pseudocode and using the Python keyword def to announce the title by which the pseudocode unit will be known. More precisely, we will begin a pseudocode unit with a statement of the form def name():

Stepwise refinement

Which is essentially the technique of not trying to conquer an entire task (in all its detail) at once. Rather, stepwise refinement proposes that one first view the problem at hand in terms of several subproblems. The idea is that by breaking the original problem into subproblems, one is able to approach the overall solution in terms of steps, each of which is easier to solve than the entire original problem.

Algorithm

before a computer can perform a task, it must be given an algorithm telling it precisely what to do; consequently, the study of algorithms is the cornerstone of computer science.

Executing a program

to execute a program is to execute the algorithm represented by the program, so a process could equivalently be defined as the activity of executing an algorithm.


Kaugnay na mga set ng pag-aaral

Fundamentals Evolve practice questions

View Set

Biodiversity Unit 3 Review: Part 4

View Set

HESI Case Study: Myasthenia Gravis

View Set

Chapter 57: Concepts of Care for Patients With Pituitary and Adrenal Gland Problems

View Set

Chapter 11 Mendel and the Gene Idea

View Set

Patho Chapter 12: Disorders of White Blood Cells

View Set

Unit 1, Unit 2, Unit 3, Unit 4, Unit 5, Unit 6

View Set