














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
A front sheet for an assignment in Procedural Programming for the BTEC Level 5 HND in Computing. The assignment requires students to design and implement a grade management program for a class, using procedural programming concepts such as variables, selection structures, iteration structures, functions, and parameter passing. The document also includes an introduction to procedural programming and its principles.
Typology: Lecture notes
1 / 22
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 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
Grade: Assessor Signature: Date: Lecturer Signature: Table of Contents 1 Introduction (P1) ................................................................................................................................................................... ...
Scenario ............................................................................................................................................................ ......... 4 2 PRINCIPLES OF PROCEDURAL PROGRAMMING. .......................................................................................................................................... ............................ 2.1 COMPUTERS & PROGRAMS ................................................................................................................................................... .................. 4 2.1.1 Definition ............................................................................................................................................ 2.1.2 What is coding and how does it work? ...............................................................................................
3.2.1 If-Else Statement ................................................................................................................................. 3.2.3 Switch-case………………………………………………………………………………………….. 3.2.3 Enter the number of students and create a list ................................................................................... 3.3 Hierarchical diagram of the program .................................................................................................. 3.3 Design a procedural programming solution for a given problem .......................................................... 3.3.1 Use-Case Diagram .............................................................................................................................. 3.3.2 Flow chart diagrams ...........................................................................................................................
1.1 Scenario A math teacher wants a grade management program for a class. He asks you to help him write a small app to do that. He needs to enter the student's number, the student's score, and store this information in two separate arrays (the integer array for the student number and the real array for the score). Then, he needs to print all the student cards along with their grades. Finally, he needs to know which student has the highest and lowest scores. Your program should have a menu based on the options above. When an option is done, the program will go back to the main menu so he can choose another option. There will be an option to exit the program.
2.1.1 Definition A computer is a machine that can be instructed to carry out sequences of arithmetic or logical operations automatically via computer programming. Modern computers have the ability to follow generalized sets of operations, called programs. These programs enable computers to perform an extremely wide range of tasks. A "complete" computer including the hardware, the operating
system (main software), and peripheral equipment required and used for "full" operation can be referred to as a computer system. Today’s computers are electronic devices that accept data (input), process that data, produce output, and store (storage) the results. Figure 1: Definition Computer A computer program is a collection of data and instructions that can be executed by a computer to perform a specific task. A computer program is usually written by a computer programmer in a programming language. From the program in its human-readable form of source code, a compiler or assembler can derive machine code—a form consisting of instructions that the computer can directly execute. Alternatively, a computer program may be executed with the aid of an interpreter. Computer programs may be categorized along functional lines, such as application software and system software.
programmers to translate important commands into binary code. (Computer Science Degree Hub,
Program development process:
2.2.2 Variable Variables are containers for storing data values. In C there are 5 basic data types. All other data types are based on one of these. The 5 data types are: ➢ Int: is an integer, it basically denotes the natural size of integers. ➢ Float and double: are used for floating point numbers. The float (real number) type takes up 4 bytes and can have up to 6 part numbers after the decimal point, while double occupies 8 bytes and can have up to 10 decimal places. ➢ Char : occupies 1 byte and can store a single character. ➢ Void: is typically used to declare a function that does not return a value. This will be discussed more clearly in the function section. The memory capacity and range of these types vary with each processor type and the installation of C compilers. Figure 5: Variable 2.2.3 Three constructions ➢ Sequence construct A sequence construct tells the CPU (processor) which statement is to be executed next. By default, in popular languages, this is the statement following the current statement or first statement in the program. In other words, this is the very basic construct of writing a program. You just write line by line what you have in mind (of-course related to programming).
Figure 7: Selection Structure ➢ Iteration Structure A repetition construct causes a group of one or more program statements to be invoked repeatedly until some end condition is met. For example, let's say we have 20 working days in a month and we have to calculate the full month's salary for our employees. In this case, "some of the last conditions met" will refer to whether we repeated the same instruction sequence or repeated 20 times. We also use the term 'loop' rather than reset or repeat. (Mukit, 2018) So the whole process in one visualization below: Figure 8: Iteration Structure 2.2.4 Function
Function definition syntax:
elements defined in the interface are detectable by other modules. The implementation contains the working code that corresponds to the elements declared in the interface. Modular programming is closely related to structured programming and object-oriented programming, all having the same goal of facilitating construction of large software programs and systems by decomposition into smaller piece. While the historical usage of these terms has been inconsistent, "modular programming" now refers to the high-level decomposition of the code of an entire program into pieces: structured programming to the low-level code use of structured control flow, and object-oriented programming to the data use of objects, a kind of data structure. Figure 14: Modularity
3.1 Identify Input, Output 3.1.1 In/Out variables
I use int and float to find the lowest grades Figure 17: Find low grades : Use for determine student number : The if helps us to find the lowest grades 3.1.6 Find max
Figure 18: Find high grades : The if helps us to find the highest grades 3.1.7 Menu selection Figure 19: Menu selection 3.2 The required construction for the Management solution 3.2.1 If-Else Statement ➢ IF-Else Statement(max)
Figure 19: switch-case The purpose of using the switch case is to make a user selection from the menu. Switch case statement is used when trying to check for an integer value. To be optimal for helping teachers manage classes, if the number of conditional expressions to compare is too much, we prefer to use switch case statements because the syntax is clearer.
3.3 Hierarchical diagram of the program
3.3 Design a procedural programming solution for a given problem 3.3.1 Use-Case Diagram 3.3.2 Flow chart diagram Flow chart to find highest grades