Computer Science
Procedural Programming
Procedural programming is a programming paradigm that involves breaking down a program into smaller, more manageable procedures or functions. These procedures are executed in a specific order to achieve a desired outcome. It is a structured approach to programming that emphasizes the use of procedures and functions to solve problems.
Written by Perlego with AI-assistance
Related key terms
1 of 5
8 Key excerpts on "Procedural Programming"
- eBook - PDF
- Kyla McMullen, Elizabeth Matthews, June Jamrich Parsons, , Kyla McMullen, Kyla McMullen, Elizabeth Matthews, June Jamrich Parsons(Authors)
- 2021(Publication Date)
- Cengage Learning EMEA(Publisher)
PROGRAMMING WITH C++ 496 Procedural Paradigm Applications (27.2.4, 27.2.5) As a programmer, you can apply the procedural paradigm to any programming problems that can be approached as a series of steps. It is a particularly effective approach for problems and tasks such as those in Figure 27-6. Figure 27-6 The procedural paradigm works well for these types of applications Repetitive tasks where the same set of steps can be applied to different data sets Large applications that can be divided into modules Systems that require optimized performance Processing paychecks requires the same calculations every week, but for varying work hours Online stores with modules for inventory management, shopping carts, payment processing, and delivery logistics Launching spacecraft Any problem where the solution naturally involves a series of sequential steps or calculations Processing survey data davooda/Shutterstock.com Advantages of the procedural paradigm include the following: • Program structure corresponds closely to the linear sequence in which the CPU executes instructions, so programs run quickly and efficiently • Easy to learn and is a classic approach understood by most programmers • Most popular programming languages support the procedural approach • Flexibility for successfully implementing a wide range of problems and coding tasks • Modularity allows a team of programmers to contribute code segments to a comprehensive application program The disadvantage of the procedural paradigm is that it does not fit gracefully with certain categories of problems. - eBook - PDF
A Short Course in Computational Science and Engineering
C++, Java and Octave Numerical Programming with Free Software Tools
- David Yevick(Author)
- 2012(Publication Date)
- Cambridge University Press(Publisher)
Chapter 6 Procedural Programming basics The following three chapters introduce basic C++ program structure and syntax in the context first of Procedural Programming and subsequently, in the two later chapters, of object-oriented programming. The material in these chapters addresses the significant challenges encountered by beginning programmers. 6.1 Scientific software development Procedural programing follows a clearly defined set of steps, which are discussed individually in this section. Problem definition. First, a problem description that captures the main sce- narios (possible outcomes), including possible abnormal situations, such as, for example, those generated by erroneous input data, should be formulated. Detailed specification. A program specification comprises a detailed solution strategy such as the form and content of the input and output data, the equations to be programmed, the numerical methods to be employed, the hardware and software to be used and the manner in which the code will handle the various scenarios. This can be facilitated by first generating the input and output screens that the user will encounter. Iterative coding and modular testing. Subsequently, the program tasks should be compartmentalized into functions. Each of these should be verified indepen- dently with a set of test data that is subsequently saved in comment lines for possible future use. Comments should be supplied for each additional function or block of code and the verified code modules packaged for reuse in other projects. As a rule, only a single change or function is added to the program at a time before retesting. In addition, before implementing any non-trivial change, the previous version of the code (with an appropriate version number) should be saved in case an inadvertent error is introduced. - eBook - PDF
Programming with Mathematica®
An Introduction
- Paul Wellin(Author)
- 2013(Publication Date)
- Cambridge University Press(Publisher)
6 Procedural Programming Loops and iteration · Do loops and For loops · Random permutations · While loops · NestWhile and NestWhileList · Flow control · Conditional functions · Piecewise-defined functions · Which and Switch · Argument checking · Classifying points · Sieve of Eratosthenes · Sorting algorithms Conventional programming languages like C and Fortran embody a style of programming that has roots in the early days of computing when resource constraints forced programmers to write their code in a step-by-step manner. These procedures, as they came to be known, typically involved certain basic elements: looping over an array, conditional statements that controlled the flow of execution, logical constructs to build up tests, and functions to jump from one place in a program to another. Although newer languages have introduced many new programming paradigms, Procedural Programming continues to be used and remains an appropriate style for certain kinds of problems. A procedure is a series of instructions that are evaluated in a definite order. The following program is a procedure. In[1]:= mat = 88a, b, c<, 8d, e, f<, 8g, h, k<<; In[2]:= newmat = mat; In[3]:= Do@newmat@@i, jDD = mat@@j, iDD, 8i, Length@matD<, 8j, Length@matD - eBook - ePub
Information Technology
An Introduction for Today's Digital World
- Richard Fox(Author)
- 2020(Publication Date)
- Chapman and Hall/CRC(Publisher)
imperative) programming languages (aside from LISP, which is a functional language). The procedural approach to programming consists of writing a program that is a collection of subroutines. A subroutine can invoke another subroutine so that the pattern of execution is based on subroutines calling each other. Each subroutine has its own local variables, the entire program may have global variables, and subroutines communicate to each other through parameter passing.8.2.3 OBJECT -ORIENTED PROGRAMMINGIn 1963, the language Simula-I was developed. The goal for that languages was to write simulation-based programs. To write a simulation, you define a model using variables and equations (e.g., physics equations to simulate an object’s motion). For Simula, models are created by defining a class of object. The class - eBook - ePub
Anyone Can Code
The Art and Science of Logical Creativity
- Ali Arya(Author)
- 2020(Publication Date)
- Chapman and Hall/CRC(Publisher)
This allows us to use known methods of problem-solving and creativity within the context of programming. Also, it helps us use the algorithmic thinking approach in non-programming tasks and solve our other problems more efficiently. But let’s not get ahead of ourselves. We will talk about these in Chapter 2. But first, let’s talk about a few important subjects that will help you explore the book and understand why it is structured in this particular way. I.1 Software Development The word “software” refers to the collection of information that a computer uses. The “soft” part is due to the fact that it can easily change, as opposed to the physical device, or hardware, that is less flexible. 7 The terms “computer programing,” “coding,” “software development,” and “software engineering” are frequently used in the computer industry and literature. They are very much related but not quite the same. While there may be different definitions and interpretations, the most commonly used one defines computer programming as the act of creating a program, a set of executable instructions in a formal language that can be (after some steps) executed by a computer to achieve a particular purpose or result. 8 The key elements of this definition are (1) instructions or program, (2) language, (3) execution by a computer, and (4) purpose or results. Key Point: Programming is the process of creating a computer program (set of executable instructions) in a formal language for a particular purpose. The term Code is frequently used as equivalent to Program, but it can also mean a part of the program (as opposed to data) and also a specific representation of a program’s instruction (as in “machine code” vs. “human-readable code”). In this book, I make a distinction between code and data as two parts of a program: the information used by the program and the operations performed on that information - Kenneth J. Luterbach(Author)
- 2018(Publication Date)
- Routledge(Publisher)
Computer ProgrammingComputer programming languages are tools for problem solving and creative expression. Indeed, people engaged in creative problem solving with computer programming languages developed technologies that resulted in the epochal transformation of the past half century. This information era is marked by computer programs (software) that implement the communication protocols enabling the Internet and the web; software enabling mobile communications; software enabling email and other messaging; software for shopping; software for creating 2D images and 3D models; animation software; office productivity software; voice recognition software, and software for learning, for instance. Learning a computer programming language is extremely beneficial as an outlet for creative expression and problem solving.One selects a particular programming language to fit a variety of circumstances. When it is necessary to receive and respond to data at particular microsecond intervals, one writes code in a low-level programming language using the CPU’s instruction set, which addresses memory and input ports directly. Commonly, though, application software is written in a high-level computer programming language, which eliminates the need to consider the computer’s architecture. After distinguishing between low-level and high-level computer programming languages, it is helpful to recognize four main programming paradigms: imperative (procedural/ structural); object-oriented; functional; and logical. Each paradigm has something to offer problem solvers (Kedar, 2011). In this book, we will not be using Haskell (Thompson, 2011) or any functional programming language (so no f(g(x)) for us in this work). Also, we do not consider a logic programming language, such as Prolog. We will consider object-oriented concepts, as necessary. Object-oriented languages, such as C++, C# (C sharp), Objective-C, and Java include imperative language components. Indeed, C++, C#, and Objective-C are implementations of C with objects. C, like JavaScript, Perl, Lua, Swift, Java, and Python, all have imperative (procedural) language components, which enable input/output, and solve problems using the following core elements:- eBook - PDF
Inventing Software
The Rise of Computer-Related Patents
- Kenneth Nichols(Author)
- 1998(Publication Date)
- Praeger(Publisher)
With nonprocedural languages, users need only describe the data and the relations that are appropriate to the application, not the detailed program steps" (Klepper and Bock 1995). This definition also serves to illustrate how 4GLs resemble PROLOG, namely, that the program is framed in terms of the result, not in terms of the steps needed to achieve that result. As the ba- sis of a software invention, all these are likely to present more specification problems than an invention patterned on the imperative or object-oriented models. But as expressions of software inventiveness or creativity, are they less entitled to protection? WHAT IS A PROGRAM? In the foregoing discussion we have seen that whereas programming fol- lows many different paradigms, software patenting procedures are modeled after only one of these paradigms. The remaining programming modes suf- fer varying degrees of incompatibility, ranging from relatively little (object- oriented) to a great deal (declarative). They also leave open the question, What is programming? Allen Newell, in a critique of the patent model, has redefined algorithm as any specification that can control the computer. [A]las, for our models, the reality of computer science moves on. This reality lead to conceptually richer ground that is highly productive for both theory and applica tion. But it destroys the clean model whereby an algorithm could be recognized b its having a procedural form. Computer science takes an algorithm to be any spec cation that determines the behavior of a system. These specifications can be of kind whatsoever as long as they actually provide the determination through the in- terpreter. Consequently, the form of the specification need no longer be procedural Sequences of steps must march out after interpretation, but sequences of steps nee not march into the interpreter. This is hardly an idle possibility. We now have languages for writing algorithms that look very different from a sequence of steps. - No longer available |Learn more
- June Jamrich Parsons(Author)
- 2016(Publication Date)
- Cengage Learning EMEA(Publisher)
The declarative paradigm might sound similar to the procedural paradigm, but it is fundamentally different. Whereas the procedural paradigm focuses on an algorithm that describes a solution, the declarative paradigm focuses on describing the problem. The procedural paradigm focuses on how ; the declarative paradigm focuses on what . Figure 11-51 summarizes these dif-ferences. Procedural paradigm: Programs detail how to solve a problem Very efficient for number-crunching tasks Object-oriented paradigm: Programs define objects, classes, and methods Efficient for problems that involve real-world objects Declarative paradigm: Programs describe the problem Efficient for processing words and language What are the building blocks for the declarative paradigm? Many declarative programming languages, such as Prolog, use a collection of facts and rules to describe a problem. In the context of a Prolog program, a fact is a statement that provides the computer with basic information for solving a problem. In the pizza problem, for example, these facts might include: A pizza has a price of $10.99, a size of 12 inches, and a round shape. Another pizza has a price of $12.00, a size of 11 inches, and a square shape. In the context of a Prolog program, a rule is a general statement about the relationship between facts. For example, the following rule is useful for solv-ing the problem of which pizza is a better deal: A pizza is a better deal if its square-inch price is less than the square-inch price of another pizza. FIGURE 11-51: PROGRAMMING PARADIGMS TAKE DIFFERENT APPROACHES QUICKCHECK In which programming paradigm do programmers focus primarily on what rather than how ? a. Procedural b. OO c. Declarative Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.







