Procedural Programming: Foundations and Applications, Study notes of Marketing

A comprehensive overview of procedural programming, including its characteristics, key features, and practical applications. It delves into the fundamental concepts of procedural programming, such as data types, data structures, and conditional statements, and illustrates these concepts through detailed examples. The document also presents a structured approach to program design, including the use of work breakdown structures (wbs), use case diagrams, and flowcharts, to ensure the development of efficient and maintainable procedural programs. Additionally, the document discusses the advantages and disadvantages of procedural programming, highlighting its suitability for general-purpose programming, portability, and code reusability, as well as its potential challenges in terms of code complexity and performance. This document serves as a valuable resource for students and aspiring developers seeking to understand the principles and practical applications of procedural programming.

Typology: Study notes

2021/2022

Uploaded on 12/23/2022

vang-phu-qui-fgw-hn
vang-phu-qui-fgw-hn šŸ‡»šŸ‡³

9 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT 1 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Prog102: Procedural Programming
Submission date
Date Received 1st
submission
Re-submission Date
Date Received 2nd
submission
Student Name
Vang Phu Qui
Student ID
GCH211017
Class
GCH1106
Assessor name
Dinh Duc Manh
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Qui
Grading grid
P2
P3
M1
M2
D1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Procedural Programming: Foundations and Applications and more Study notes Marketing in PDF only on Docsity!

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Prog 102 : Procedural Programming

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Vang Phu Qui Student ID GCH

Class GCH1106^ Assessor name Dinh Duc Manh

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice.

Student’s signature Qui

Grading grid

P1 P2 P3 M1 M2 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:

Lecturer Signature:

1.Introduction

1.1: General Procedural programming language helps the developer or programmer to build large application programs in effective manner with the help of divided into smaller program also known as functions. In addition in procedural programming language most of the functions are to be shared in global data that helps the developer to move data and instructions openly within the system from one function to other functions. In addition to build an effective programming language developer implements the top down approach i.e. programming paradigm. In addition procedural programming helps the programmer in order to break down application program into a data structure, variables and subroutine(Kochan, 2005). Procedural programming languages or code of instruction are executed very fast and required less memory. Moreover, procedural programming language allows developer to develop general purpose programming and offers better level of controls as well as portable source code. Thus it is said that procedural programming involves that it can be used to evaluate and analyze all distinguish areas of life and provides better solutions of complex program.

1.2: Characteristics about procedural programming.

1.2.1 Characteristics ļ‚· A top-down method is used in procedural programming. ļ‚· The program is organized into functions, which are blocks of code that each execute a specified purpose. ļ‚· Real-world processes are modeled as ā€˜procedures’ that operate on ā€˜data’ in procedural systems. ļ‚· Data and functions are separate from one another. ļ‚· In software, data is free to move about. ļ‚· It’s simple to follow a program’s logic. ļ‚· By invoking another function, a function can have access to its data.

1.2.2 Key feature:

  • Predefined functions: A predefined function is a type of instruction that has a name attached to it. Predefined functions are usually included in higher-level programming languages; however, they are drawn from a library or registry rather than a program.

  • Local Variable: A local variable is a variable that is defined in the method’s primary structure and is only used inside the scope of the method. The local variable can only be used in the method in which it is defined; if it is used outside of that function, the code will fail.

  • A global variable is a variable that is declared outside of any other functions created in the code. As a result, unlike local variables, global variables can be utilized in any function.

  • Modularity occurs when two distinct systems have two separate jobs to complete, yet they are joined together to complete a bigger task first. The tasks of each set of systems would subsequently be completed one by one until all tasks were completed.

1.4 How Procedural Programming can be applied this proble A procedural programming language is one that uses sets of functions and commands to complete actions. Many programming languages use the procedural programming paradigm, including BASIC, C and Pascal.Learning to program in a procedural programming language is often a foundational learning experience for aspiring developers, with many professional programmers starting their careers by learning a procedural programming language.

A flowchart is a graphic means of documenting a sequence of operations. Flowcharts serve as a pictorial means of communicating from one person to another the time- ordering of events or actions. As a pictorial format, flowcharts have been the subject of both an International and an American National Standard. Flowcharts go by many other names, including block diagrams, flow diagrams, system charts, run diagrams, process charts, logic charts.

Picture 1 : Example for Flowchar

2.2:Data structure ļ‚· Structure: In C, a structure is a keyword that defines a user-defined data type. A structure provides a data type that may be used to combine objects of potentially disparate types into a single type.

Picture : Example for structure ļ‚· Function: Functional programming languages are a class of languages designed to reflect the way people think mathematically, rather than reflecting the underlying machine. Functional languages are based on the lambda calculus, a simple model of computation.

Picture : Example for function

2.3 Conditional statements needed in the problem:

  • If-else statement: When the Boolean expression is false, an if statement might be followed by an optional else statement.

Picture : Example for if-else

  • For statement: A for loop is a repetition control structure that lets you design a loop that has to run a certain number of times quickly.

Picture : Example of for statement

3:Design

3.1 WBS

Picture 2: WBS for program

The program is divided in to 5 sub-functions:

  • Function 1: Enter student information
  • Function 2: Find student by code
  • Function 3: Show the student’s highest grade
  • Function 4: Show the student’s lowest grade
  • Function 0: Exit the management program

3.2 Use case

Picture 3: Use case diagram

  • Use-case diagrams describe the high-level functions and scope of a system. These diagrams also identify the interactions between the system and its actors. The use cases and actors in use-case diagrams describe what the system does and how the actors use it, but not how the system operates internally.

Picture 5: Flowchart for menu

Picture 6: Example for function search student by code

You must declare a count variable for this function that will run from 0 to ā€œnā€. The text code you enter will be checked. If the list has the same string, the computer will display information about the student who has this code.

Picture 8: Example for find min

This function includes 3 steps:

  • Step 1: Declare and assign the first value is min.
  • Step 2: Compare with others, which value larger is assigned to the min.
  • Step 3: Print that student who has the max grade on the screen.

4.Evaluation

4.1: General evaluation We were able to completely create a student administration with the essential powers by applying the core information we had gained to the C programming language. Explanations and circles help us save time and ensure consistency and accuracy. They are necessary, easy to get, simple to hone, and operate remarkably effectively. The WBS and flowchart are constructed clearly and consistently, breaking down the whole lesson into complete subroutines and satisfying all of the teacher’s criteria.

4.2: Advantage and disadvantages of procedural programming ļ‚· Advantage:

  • The programmed simplicity, as well as the ease of implementation of compilers and interpreters, make procedural programming ideal for general-purpose programming.
  • A wide range of books and online course materials on tested algorithms are accessible, making it easy to study as you go.
  • Because the source code is portable, it may also be used to target a different CPU.
    • It is not necessary to replicate the code because it may be reused in various portions of the application.
    • The memory need is also reduced using Procedural Programming approach.
    • The program’s flow can be simply followed. ļ‚· Disadvantage:
    • When Procedural Programming is used, the computer code is more difficult to write.
    • Because procedural code is frequently not reusable, it may be necessary to rebuild it if it is required for usage in another application.
    • Relationships with real-world items are difficult.
    • The procedure is prioritized over the data, which may cause problems in data-sensitive situations.
    • Because the data is visible to the entire program, it is not very secure.

The most problematic aspect of procedural programming is that, while being a high-level language, procedural code is slower than code written in a lower-level language. Processing also needs a higher level of processing capacity than for other languages. This has had a direct impact on the outcomes of procedural programming.

5 Reference: Tausworthe, R., 1979. The work breakdown structure in software project management. Journal of System and Software. Katz, J. and McGee, W., 1963. An experiment in non-procedural programming. Proceedings of the November 12-14, 1963, fall joint computer conference.