
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about an assignment for the Prog102 unit of the BTEC Level 5 HND Diploma in Computing, which focuses on Procedural Programming. instructions for the assignment, key features of Procedural Programming, and examples of programming constructs such as if statements, for loops, and switch case statements. The assignment requires students to write a program in C language to manage student data, including entering student IDs and grades, storing the data in arrays, and determining the highest and lowest grades.
Typology: Essays (university)
1 / 24
This page cannot be seen from the preview
Don't miss anything!

















Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Prog102: Procedural Programming Submission date June 15th^2022 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Truong Duy Minh Student ID GCD Class PROG102 Assessor name Phan Thanh Tra 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 M Grading grid P1 P2 P3 M1 M2 D
Grade: Assessor Signature: Date: Lecturer Signature:
In recent year, management system is popular around the world and familiar with most jobs. Basically, A Management Information System or MIS is a systematic organization and presentation of information that is generally required by the management of an organization for taking better decisions for the organization. Moreover, a management system can help users solve their problem in many major. The effects of this program will be explained and presented in detail so users will understand how a management system work and evaluate the product.
C is a general-purpose computer programming language. It was created in the 1970s by Dennis Ritchie, and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of the targeted CPUs. It has found lasting use in operating systems, device drivers, protocol stacks, though decreasingly for application software, and is common in computer architectures that range from the (Anon., n.d.) largest supercomputers to the smallest microcontrollers and embedded systems. In this program, I will use C language to make the application according to the user’s requirements. Figure 3: Some advantage of C language
Procedural programming is the one that directly instructs a device on how to finish a task in logical steps. This paradigm uses a linear top-down approach and treats data and procedures as two different entities. Based on the concept of a procedure call, Procedural Programming divides the program into procedures, which are also known as routines or functions, simply containing a series of steps to be carried out. (Anon., n.d.) Figure 4: Procedure Oriented Programming Language
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.
Variable name Data type NUMBER OF STUDENT IN CLASS numberOfStudents^ Integer STUDENT IDs studentID Integer array STUDENT’S GRADE studentGrade Float array USER’S OPTION MENU optionMenu Integer STUDENT HAS HIGHEST GRADE highestGrade Float STUDENT HAS LOWEST GRADE lowestGrade Float Figure 6: Variable name and Data types
You can use if statement to control whether or not a program enters a block of code based on whether or not a particular condition is true or false. One of the important functions of the if statement is that it allows the program to select an action based upon the user's input. For example, by using an if statement to check a user-entered password, your program can decide whether a user is allowed access to the program. (Anon., n.d.)
An If else statement in programming is a conditional statement that runs a different set of statement depending on whether an expression is true or false. (Anon., n.d.) Figure 9: Syntax of if else statement Figure 10: Example of if else statement c. Switch case statement Switch statement in C tests the value of a variable and compares it with multiple cases. Once the case match is found, a block of statements associated with that particular case is executed. (Anon., n.d.) Each case in a block of a switch has a different name/number which is referred to as an identifier. The value provided by the user is compared with all the cases inside the switch block until the match is found.
Figure 11: Syntax of switch case statement Figure 12: Example of switch case statement
Figure 15: Example of defining a function Calling a Function: While creating a C function, you give a definition of what the function has to do. To use a function, you will have to call that function to perform the defined task. Figure 16: Example of calling a function
Function “inputInformation()” has function to help the math teacher to enter ID and grade of students and check that if both of them are valid or not via “array” to store them, “for” loop and “do…while” loop. Function “outputInformation” helps the math teacher to display the grade corresponding to the ID which are stored previously from function “inputInformation” via “do…while” loop.
Figure 19: Flowchart of program
Step 3: Figure 20: Flowchart of viewMenu Case option 1 Enter number of students Enter information of each student (including ID and grade). If student’s ID exist, the user will receive a re-entry request When user finishes entering student information, program go back to the main menu Step 2 Case option 2 All students information will be showed in screen When the option to has done, program go back the main menu Step 2 Case option 3 Show the student has highest grade Program go back the main menu Step 2 Case option4 Show the student has lowest grade Program go back the main menu Step 2 Case option 5 Exit program Program end