















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Prog 102 : Procedural Programming Submission date 22/08/2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Dang Nguyen Dang Khoi Student ID GCC
Class GCC0903 Assessor name Le Huynh Quoc Bao
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 Khoi
Grading grid P1 P2 P3 M1 M2 D
Grade: Assessor Signature: Date:
Lecturer Signature:
A math teacher wants to manage grades of a class. He asks you to help him to write a small application to do that. He needs to enter student IDs, student’s grades and store these information into 2 separate arrays (integer array for IDs and float array for grades). Then he needs to print all student IDs together with their grades. Finally, he needs to know which student has highest grade and lowest grade. Your program should be menu based with the options above. When an option is done, the program should go back to the main menu so he can choose another option. There should be an option to quit program.
To prove your programming ability to be appointed to this small project, please prepare an illustrated guide on programming in general and a particular emphasis on procedural programming. Here you will need to include introduction to computer programming languages and discuss key features of procedural programming.
Your next task is to do the analysis for the scenario mentioned above by doing the following subtasks
You need to use a drawing tool to draw design diagram for your program, includes:
Predefined functions: A predefined function is typically an instruction identified by a name. Usually, the predefined functions are built into higher-level programming languages, but they are derived from the library or the registry, rather than the program. One example of a pre-defined function is ‘charAt()’, which searches for a character position in a string. Local Variable: A local variable is a variable that is declared in the main structure of a method and is limited to the local scope it is given. The local variable can only be used in the method it is defined in, and if it were to be used outside the defined method, the code will cease to work. Global Variable: A global variable is a variable which is declared outside every other function defined in the code. Due to this, global variables can be used in all functions, unlike a local variable. Modularity: Modularity is when two dissimilar systems have two different tasks at hand but are grouped together to conclude a larger task first. Every group of systems then would have its own tasks finished one after the other until all tasks are complete. Parameter Passing: Parameter Passing is a mechanism used to pass parameters to functions, subroutines or procedures. Parameter Passing can be done through ‘pass by value’, ‘pass by reference’, ‘pass by result’, ‘pass by value-result’ and ‘pass by the name’ (Bhatia, 2021).
II. Identify the program units and data and file structures required to
implement a given design
1 ID[] integer
The array used to store the ID of student with the data type is integer because it will help it easy storage in the array and help user easy receive information when it display in the screen of computer. 2 Grade[] float The array used to store the point of student with the data type is float because the point can be a decimal number.
3 Min float
The variables used to store and display lowest grade from the array with the data type is float because the lowest grade can be a decimal number.
4 Max float
The variables used to store and display highest grade from the array with the data type is float because the highest grade can be a decimal number.
‘if’ Statements
if ( condition) { // one or more statements; } else { // one or more statements; }
If Statement is simply a set of operation which could be used to compare expressions. These generally have two values of LHS and RHS. This operator compares the expression of the left-hand side and right-hand side. In comparison, it simply returns a Boolean value (Pedamkar, 2019).
‘if’ Statement used when we find highest grade and lowest grade. It helps us compare and assign highest or lowest grade to variable.
For statement
for(initialization; condition; increment/ decrement) { // one or more statement; }
For statement is used to check condition, compare with a fixed value, and execute commands, for example: print, compare and assign value,… after each iteration. When the condition false, it will stop program.
It is a convenient method of communication. It indicates very clearly just what is being done, where a program has logical complexities. A key to correct programming. It is an important tool for planning and designing a new system. It clearly indicates the role-played at each level. It saves the inconveniences in future and serves the purpose of documentation for a system. It provides an overview of the system and also demonstrates the relationship between various steps. Facilitates troubleshooting. It promotes logical accuracy. It makes sure that no logical path is left incomplete without any action being taken (Tutsmaster, 2019).
The flowchart is a waste of time and slows down the process of software development. The flowchart is quite costly to produce and difficult to use and manage. Flowcharts are not meant for man to computer communication. Sometimes the Complex logic of the program logic is quite complicated to draw out on by using different defined shapes. In that case, flowchart becomes complex and clumsy. This will become a pain for the user, resulting in a waste of time and money trying to correct the problem If you need to modify or alternate the process then it will be very hard to do in the flowchart. Because either you will have to erase the end of the flowchart or start (Tutsmaster, 2019).
It helps us have an overview of each task of the program. It helps coders easier, faster and make less mistakes when they code. For example, false algorithm, condition, miss program tasks. The roles of each level are clearly divided. We can easy fix program when it errored.