Docsity

Assignment Brief 1 procedural programming, Study Guides, Projects, Research of Project Management

Partial preview of the text

Download Assignment Brief 1 procedural programming and more Study Guides, Projects, Research Project Management in PDF only on Docsity!

Assignment Brief 1 (RQF)

Higher National Certificate/Diploma in Computing

Unit Number and Title Unit 0: IT Fundamental & Procedural Programming Academic Year 2022 Unit Tutor Assignment Title Analysis and Design a solution for procedural programming problem Issue Date Submission Date 22/02/20 22 IV Name & Date Learning Outcomes and Assessment Criteria Pass Merit Distinction LO1 Understand the principles of procedural programming LO2 Be able to design procedural programming solutions P1 Provide an introduction to procedural programming M1 Discuss on characteristics and features of procedural programming D 1 Critically evaluate the design of your solution against the characteristics and features of procedural programming. P2 Identify the program units and data and file structures required to implement a given design M2 Review the design of a procedural programming solution. P3. Design a procedural programming solution for a given problem Assignment Brief Scenario: 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

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Prog102: Procedural Programming Submission date 22/02/2022 Date Received 1st submission Re-submission Date 27/02/20 22 Date Received 2nd submission Student Name Ly Nguyen Student ID GCS Class GCS1003A Assessor name Le Ngoc Thanh 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:

ASSIGNMENT_

PROCEDURAL PROGRAMMING

I. INTRODUCTION

1. OBJECTIVES

➢ LO1 Understand the principles of procedural programming ➢ LO2 Be able to design procedural programming solutions 2. PROGRAMMING LANGUAGE (P1) ❖ A programming language is a computer language that is used by programmers (developers) to communicate with computers. It is a set of instructions written in any specific language ( C, C++, Java, Python) to perform a specific task. Figure 1: Some popular programing languages (Shutterstock. 2022.)

3. PROCEDURAL PROGRAMMING (P1, M1)

a) Procedural programming paradigm Figure 2 : Procedural programming paradigm (Hexainclude.com. 2022.) Procedural Programming may be the first programming paradigm learned by a new developer. Fundamentally, procedural code is the one that tells a device how to do a task in logical stages. This paradigm employs a top-down linear approach and regards data and methods as distinct entities. Procedural Programming separates the program into procedures, which are sometimes known as routines or functions and simply comprise a set of actions to be carried out, based on the notion of a procedure call. (Hackr.io. 2022.) b) Key Features of Procedural Programming The key features of procedural programming are given below:

  • Predefined functions: A function is a method that can be called by its name in the program. Predefined functions are also called built-in functions. They are the set of subroutines that are used for specific functionalities.
  • Local Variable : Variables in programming languages are storage spaces with specific names. Users can assign values to them. They are used to reference a stored value in a program.
  • Global Variable : A global variable, unlike a local variable, is defined outside of a function. Due to this reason, it can be used at any place in the program, i.e., its scope is the whole program, unlike a local variable, which has scope only inside the block of code where it was defined.
  • Modularity : Modularity refers to the use or application of modules, often known as pieces or parts. It involves breaking down a complex problem into smaller parts in order to tackle it quickly. It entails breaking the program's functionality into independent smaller sections, and each element can execute the specific function for which it was created.

( Hackr.io. 2022. ) d) Conclusion Procedural Programming is more of what you are doing than how you are doing it. It is the standard approach used in many computer languages such as C, Pascal, and BASIC. While there is no perfect programming paradigm, it is important to understand that the correct paradigm will always depend on the type of language you use and the program you wish to create. To get the best results and a strong portfolio, you need to be proficient in both of the three major programming paradigms. (Hackr.io. 2022.) II. PROGRAM DEVELOPMENT

1. REQUIREMENT 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. 2. GOALS The purpose of the report is to support teachers to create a program that can accommodate all their needs. In particular, after completing any options, the program will be return the main screen. So that the user can choose another option. Furthermore, the program will have option to exit. The report is a technical guide to programming in general, with a particular focus on procedural programming. 3. ANALYSIS AND DESIGN (P2, P3) a) Variables and Data Types ➢ Variables Variables are used to store data that will be referenced and altered by a computer program. They also allow us to identify data with descriptive names, making our programs easier to understand for both the reader and ourselves. Variables can be thought of as information-holding containers. They exist just to categorize and store data in memory. This information will subsequently be utilized throughout your program. ( Launchschool.com.

  1. )

Figure 3: Types of variables (Tutorialspoint.com. 2022. ) ➢ Data Types The data type of a value (or variable in certain instances) is a property that specifies the sort of data the value may contain. Most commonly, the phrase refers to static typing of variables in programming languages such as C/C++, Java, and C#, where the type of a variable is known at compile time. Integers, floating point values, strings, characters, and other storage classes are examples of data types. Data types define particular characteristics of data used in software programs and inform the compilers about predefined attributes required by specific variables or associated data objects. (Techopedia.com. 2022)

Figure 5: Table shows data about variables b) If – else statement function

  • In this program, "if" statement is used for finding the highest or the lowest grades in memory that user input. Figure 6 : Example using “if” statement function
  • In this function, the program will check the condition inside "if" first, if that's true, statements inside "if" are executed and statements inside "else" are skipped. However, if the first condition is false, the first statement is skipped and statements in the body of "else" are executed.
  • In this program, to avoid user mistype with request, user will receive a notification error and the program request user to enter again. Figure 7 : Example using “if – else” statement function c) Switch case statement function
  • First, the software will assess the condition within "switch" and compare it to the values of each "case" label. If there is a match, the statement after the matching label is processed until "break" occurs. If no match is discovered, the default statement is performed. If no break is specified, all statements are performed following the corresponding label.
  • In my report, I will use it to declare different options which users choose to report in "Menu". It will have 4 options: Figure 8 : Diagram program
  1. Enter the student's IDs and grades
  2. Print all information of current student
  3. Find the max, min
  4. Exit the program If I wanted to find the person with the highest or lowest grades, I would choose 3 and 4, after finishing, I can choose 1 to enter information of new student or choose 2 to view student information and choose 4 to exit the program.

e) FUNCTION A function is a code module that only does one thing. Sorting, searching for a specific item, and inverting a square matrix are some instances. Once a function is written, it is thoroughly tested. After that, it is added to the function library. (Cpp.edu. 2022. Functions in C++ .) Figure 10: Function example (Programiz.com. 2022. C++ Function) A function declaration tells the compiler about a function's name, return type, and parameters. A function definition provides the actual body of the function. A function is known with various names like a method or a sub-routine or a procedure etc. (Tutorialspoint.com. 2022. C++ Functions .)

III. USE CASE DIAGRAM

❖ Input function : Figure 12: Input

  • Diagram describing the function to enter student ’ s id and grade

❖ Display option: Figure 13: Display