Understanding Procedural Programming Languages: Key Features and Examples, Cheat Sheet of Programming Languages

An introduction to procedural programming languages, discussing their history, differences from low-level languages, and key features. It covers the development of high-level procedural languages and their advantages, including readability, portability, and ease of development. The document also mentions the importance of procedural programming in business applications.

Typology: Cheat Sheet

2019/2020

Uploaded on 09/17/2021

DaSimpla
DaSimpla 🇻🇳

4.4

(8)

18 documents

1 / 20

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
10/22/2020
Date Received 1st
submission
Re-submission Date
Date Received 2nd
submission
Student Name
Student ID
Class
Assessor name
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
Grading grid
P1
P2
P3
M1
M2
D1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Understanding Procedural Programming Languages: Key Features and Examples and more Cheat Sheet Programming Languages 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 10/22/2020 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Student ID Class Assessor name 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 Grading grid P1 P2 P3 M1 M2 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

Task 1: Introduction to computer programming languages and discuss key features of procedural programming.

Introduction

A programming language can be defined formally as an artificial formalism in which algorithms can be expressed. It is composed of a set of instructions in a language understandable to the programmer and recognizable by a computer. Computer languages have been continuing to grow and evolve since the 1940’s. Most programming languages encompass commands for computers. There are programming machines that use a specific set of commands, instead of generic programming languages. Programming languages allow us to communicate with computers through computer code. Each programming language is simply a means to tell the computer what to do. It is a language that our computers understand and know how to process. When it comes to learning a particular programming language, it's just like learning any other language. we need to understand how language works and follow certain rules, just like grammar in spoken language. Each language is different and you will use them for different types of projects. (Dey, 2006) Programming languagues include two types:  Low level languages(LLL);  High level languagues(HLL); o Low-Level Programming Languages are very close to the machine code (0s and 1s) and are also known as Computer-Friendly Languages.These are the Programming Languages with very less or no abstraction at all.The program instructions written in these languages are in binary form. Low-Level Programming Languages are the hardest languages to understand by programmers and need a really good knowledge of Computer Architecture and it’s working. There are 2 types of Low-Level Programming Languages available, which are discussed below:  Machine Language: Machine Language is also known as the First Generation Programming Language (1GL). The instructions in machine language are written in the form of binary codes that can immediately be executed by the processor. A machine language instruction generally has three parts as shown in Fig. 4.1.

Machine language is the fundamental language of the computer and the program instructions in this language is in the binary form. This language is different for different computers.  Assembly language: Assembly language is considered to be a second generation language (2GL). In this language, an instruction is expressed using mnemonic codes instead of binary codes. Normally anassembly language statement consists of a label, an operation code, and one or more operands. Symbolic codes are meaningful abbreviations such as SUB is used for substation operation, MUL for multiply operation and so on. The set of program instructions written in assembly language are also called as mnemonic code. Assembly language provides facilities for controlling the hardware. o High Level Languages  Definition: The programming languages that are close to human languages (example like English languages) are called the high-level languages. high-level languages are called third generation languages (3GLs). high-level programming languages were developed to make programming easier and less error-prone. The examples of high-level languages are: Fortran, COBOL, Basic, Pascal, C, C++, Java,… The high level languages are similar to English language. They are written using English words, for example print, input etc. But each high level language has its own rule and grammar for writing program instructions. These rules are called syntax of the language.  Advantages of high-level programming languages aremany fold which are as follows. Readability programs written in these languages aremore readable than those written in assembly and machine languages. Portability high-level programming languages can be run on different machines with littl or no change. It is, therefore, possible to exchange software, leading to creation of program libraries. Easy debugging errors can be easily detected and removed. Ease in the development of software Since the instructions or statements of these programming languages are closer to the english language, software can be developed with ease. The time and cost of creating machine and assembly language programs were quite high.

Illustrated image. o The Java is multi-platform programming that’s is an ideal option for networking.Obviously, typically this language is used in the web development with Java applets. Nevertheless, Java is also used to make programs that can be run on different platforms, as it is quite similar to the C++ syntax and structure. For programmers of C++, Java is an easy language to understand and learn and it also provides some benefits offered by the object-oriented programming. C++ Programming C++'s logo o For the project with a larger scope, the C++ is an ideal option because of its object-oriented structure. By using this language, the programmers can cooperate one program into other components or even one separate work on program’s all part. The object-oriented structure, in this language also allows the code written in C++ to be reused. So, it can be said that C++ is a well- organized language.

CODE C++

o When it comes to the selection of programming language, not very much depends on your personal choice and your requirements. For most of the programmers, it is a good option to select. (W3.SCS, n.d.) Procedural languages are also known as third generation languages (3GLs). In a procedural language, a program is designed using procedures. A procedural programming is a sequence of instructions having a unique name. The instructions of the procedure are executed with the reference of its name. In procedural programming languages, the program instructions are written in a sequence or in a specific order in which they must be executed to solve a specific problem. It means that the order of program instructions is very important. In procedural programming, a program is conceived as a set of logically related instructions to be executed in order. In procedural programming, each program can be divided into small self- contained program segment, each of which performs a particular task and be re-used in the program as and when required without repeated explicit coding corresponding to the segment. These sections of code are known as procedures or subroutines or functions. It also makes it easier

FORTRAN's logoALGOL : Because numerous dialects and lingos were created somewhere in the range of 1956 and 1959 making convey ability issues, different PC bunches requested ACM to suggest activity for the production of a widespread programming tongue. Delegates from production and colleges were named to a panel that met multiple times, beginning in January, and concurred that’s new dialect would be a logarithmic tongue like FORTRAN. Be that as it may, FORTRAN couldn’t be utilized as an all-inclusive language in light of the fact that, back then, it was a formation of IBM and intently attached to IBM equipment.  COBOL : it stands for common business oriented language. It was developed in 1959. this high-level language was specially developed for business and commercial applications. It was suitable for handling large amount of data such as:  To prepare payroll  To process credit and debit account  To control inventory system and many other business applications Illustrated imageBASIC : In the mid-1960s there were no PCs. In the case that you needed to register, you needed to type your code on cards, deliver them to the closest PC place, and afterward sit tight hours for the outcomes. Must be to 1964 PC reseachers planned and create a period inviting framework and built up the BASIC (Beginners All-reason Symbolic Instruction Code).

Their objectives involved simplicity of studying for the apprentice, equipment and working framework autonomy, the capacity to oblige enormous projects, and reasonable blunder message in English.  Pascal : This programming language is named in the honour of Blaise Pascal, a mathematician and scientist who invented the first mechanical calculator. Structured programming language and is popular in computer science development in 1971. It is suitable for scientific field.  C language : It is a high level language but it can also support assembly language codes (low level codes). It is because, C language is also referred to as middle level language. C's Logo The program written in C can be compiled and run on any type of computer. In other words programs written in C language are portable. C language is a structured programming language. The main feature of C language is that, it uses a large number of built-in functions to perform various tasks. The user can also creates its own functions.  ADA : It is developed in 1980 and is named in the honour of Lady Augusta ADA. She was the first computer programmer. The high level structure language Pascal was used as a model for the development of ADA language. This language is mainly used for defence purposes such as for controlling military weapons like missiles etc. (DeLine, 2005) Procedural programming language is also imperative languages.

The focal point of procedural writing PC codes is to distinguish a programming language assignment into a lot of factors. Information forms, and edit, while in object arranged programming language this is to separate a programming assignment in objects that show conduct frameworks and information individuals or traits utilizing interfaces. Example of procedural programming **Using a procedural language for building up a program may perform by performing a programming manager, similar to eclipse, or android Studio.

  • There are many cases that procedural programming languages contribute a vital to solve business problems. For example, the common business issues is Managing overheads. Overheads can easily mount up, whether they’re coming in the form of admin expenses, insurance, rent or utility charges.
  • Therefore, making a small application that can input the e-cash's informations, linking, calculating exchanging financ and storage informations of accounting by using some procedural programming can help business accountant take a look at spending and see what can be cut back, regulate and keep much statistics about cash out and in.
  • Any service that’s surplus to your team or your customers’ requirements also could be scaled down when using a small app built by procedural programming.

Advantage of Procedural Languages to solve this problem:  Procedural Programming languages are incredible for broadly helpful programming languages.  The source code is compact, along these lines, that possibly utilizes it for targeting different CPUs too.  The code may reuse in different segments of the code, without the necessity to copy this. Disadvantage of Procedural Languages to solve this problem:  The program is harder to write when Procedural languages are employed.  The information is available to the whole code, building this less safety inviting.  It isn’t viable with a true issue. (DeLine, 2005) Task 2 : The analysis for the scenario mentioned in scenario

Some variables which will be needed in this problem:

 Main(): To declare main function in this problem;  Int: Using this one to declare integer variables will be needed in the problem of the teacher:  Int i: To initialize index variable which will be used in for loop;  Int total: ‘total’ be initialized to assign a variable which help teacher can input the total of how many students in his class;  Int IDs[] : Declare the integer array for IDs which help him enter student IDs;  Int choice: Intialize this one to declare a variable will be used in menu based program.  Float : Utilizing to to declare float variables will be needed in the problem:  Float grades[]: Declare the float array for grades which help him enter student grades;

 Not only that when an option is done,the ‘switch-case’ structure will help him choose any different option in this app  This one will be used in the body of programming to become a main function of the application.  ‘do-while’ loop: this structure will be used in this problem to create the condition that will check that if the teacher choose the right option or he type the wrong option or he want to exit this program.  If he choose the right option(which no including exit option) or wrong option, the program will go back to the main menu, so he can choose another option or even if he choose the wrong, the program will never exit.  In case he want to exit program he only enter the exit option that be located in the condition of ‘while’(in the opposite sense), the program will exit right away.  For example: do{ ………} While(!=4)

  • If he enter the number 4, it will be end.  This structure will be located around the switch-case structure.

Task 3: Design solutions of the program Menu operation: Entering and printing IDs and grades Entering IDs and grades: FLOW CHART ENTERING IDS AND GRADES Finding max grade and finding min grade.

FLOWCHART FINDING LOWEST GRADE AND EVALUATION

Bibliography Anon., n.d. CodesCracker. [Online] Available at: https://codescracker.com/computer-fundamental/types-of-computer-languages.htm [Accessed 14 6 2021]. DeLine, R. &. L. K. R. M., 2005. Teach computer science. [Online] Available at: https://teachcomputerscience.com/procedural-languages/ W3.SCS, n.d. W3schools. [Online] Available at: https://www.w3schools.com/cpp/cpp_getstarted.asp