Assignment Brief 1 - programming computing, Study Guides, Projects, Research of Programming for Engineers

Assignment Brief 1 - programming computing

Typology: Study Guides, Projects, Research

2021/2022

Uploaded on 02/28/2022

nguyen-ly-6
nguyen-ly-6 🇻🇳

4.8

(10)

43 documents

1 / 26

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Assignment Brief 1 - programming computing and more Study Guides, Projects, Research Programming for Engineers 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/ 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 D1 Critically evaluate the design of your solution against the characteristics and features of procedural P2 Identify the program^ programming. 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 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

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/2022 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:

Table of Contents I. INTRODUTION 1

  1. OBJECTIVES 3
  2. PROGRAMMING LANGUAGE 4
  3. PROCEDURAL PROGRAMMING (P1) 5 II. PROGRAM DEVELOPMENT 6
  4. REQUIEMENT 7
  5. GOALS 8
  6. ANALYSIS AND DESIGN (P2, M1) 9 3.1. Variables and Data Types 3.2. If – else statement 3.3. Switch – case statement 3.4. Loop statement 3.5. Function III. DESIGN (P3) 10
  7. DESIGNING A PROCEDURAL PROGRAMMING SOLUTION FOR GIVEN PROBLEM 11
  8. USE-CASE DIAGRAM 12
  9. FLOWCHART 13 IV. REVIEW (M2) 14 V. REFERENCES 15

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.)

and each element can execute the specific function for which it was created.  Parameter Passing: In computer languages, parameter passing is a technique for passing parameters to processes or functions. The parameter should not be confused with the argument. The argument is the actual value supplied to the function and processed by the function, whereas the parameter is the value specified in the function when it is declared.  Procedures: if there is a programming procedure, the program that contains the procedure follows the procedure step by step and systematically. The program executes the commands exactly as they as they are executed in the order set by the programmer. (FinsliQ Blog. 2022.) c) Advantages and Disadvantages Advantages  Procedural Programming is excellent for general-purpose programming  The coded simplicity along with ease of implementation of compilers and interpreters  A large variety of books and online course material available on tested algorithms, making it easier to learn along the way  The source code is portable, therefore, it can be used to target a different CPU as well  The code can be reused in different parts of the program, without the need to copy it  Through Procedural Programming technique, the memory requirement also slashes  The program flow can be tracked easily Disadvantages  The program code is harder to write when Procedural Programming is employed  The Procedural code is often not reusable, which may pose the need to recreate the code if is needed to use in another application  Difficult to relate with real-world objects  The importance is given to the operation rather than the data, which might pose issues in some data-sensitive cases

 The data is exposed to the whole program, making it not so much security friendly ( 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) a) Variables and Data TypesVariables 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. 2022. )

Figure 4: Data types in C++ language (GeeksforGeeks. 2022. )  The table below contains information about the variables for which I will use this program, such as their names, data types, and descriptions. Figure 5: Table shows data about variables

b) If – else statement function

- "if" statement is used for finding the highest or the lowest grades in memory that user input.

  • 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. c) Switch case statement function
  • In my report, "switch - case" is used in main function I will use it to declare different options which users choose to report in "Menu". it will have 4 option.
  • 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. d) LOOP STATEMENT
  • The initialization statement is only run once. Following that, the test expression is evaluated. When the test expression evaluates to false, the "for" loop comes to an end. If the test expression returns true, a statement within the "for" loop body is executed to update the update expression. The retest expression is examined.
  • This process continues until the test expression becomes false. If the test expression is false, the loop ends.
  • The for loop is commonly used in my program, it is used in the main functions that support entering student information, creating a counter variable to help find the highest or lowest grade of a student, the loop is also used to print the elements in the array to the screen.  “DO – WHILE”
  • The "do-while" loop's body is only executed once. Only then is the test expression evaluated.
  • If the test expression is true, the loop body is run again, and the test expression is evaluated.
  • This method is repeated until the test expression is false.
  • The loop is terminated if the test expression is false.

III. DEIGN (P3)

1. Designing a procedural programming solution for given problem When you sit down at your computer, whether at home or at college, have you ever considered what it took to get this machine to perform what you are doing (planning, researching, creating, debugging, implementing, upgrading, and so on)? To design a solution for a given problem either in the procedural way of programming or other methods, it is simply referred to as Systems development. System development is a six-stage process or life cycle (SDLC – System Development Life Cycle) that consists of phases, which often overlap and may also include: 1) System Survey  System Identification  Selection  System Planning

  1. Needs Analysis System requirements analysis is a technique for solving problems by decomposing the components of the system. 3) Design The design or design of system development is intended to provide a complete blueprint as a guideline for the IT team (especially programmers) in making applications. 4) Implementation The stage of developing this information system is to work on a previously designed development. 5) Testing A system needs to be tested to ensure that the development carried out is appropriate or not with the expected results. 6) Change and Maintenance This step covers the whole process in order to ensure the continuity, smoothness and improvement of the system. (Teknova, P., 2022. )

2. Use-case diagram Figure 7: Use-case diagram  A use case diagram is a graphical depiction of a user's possible interactions with a system. A use case diagram shows various use cases and different types of users the system has and will often be accompanied by other types of diagrams as well. The use cases are represented by either circles or ellipses. The actors are often shown as stick figures.  In the above use case diagram, there is one actor is a teacher. There are a total of five use cases that represent the specific functionality of a student management system. The teacher can interact with all the functionalities or use cases of the system. This actor can enter the information of student, print all information to screen, find student's highest and lowest grades. These interactions of teacher actor together sum up the entire application.

Input flowchart: Figure 9: Input option

  • Explain flowchart: In this function, the first, user has to enter the number of students (with the condition 1 < n < 100). If the input is correct, the program will continue and let the user enter student’s ID (IDs should be a positive number). Then the program will keep going on to the last one which is enter student’s grades (0 < grade < 10). If the user enters it wrong, it will ask to re-enter in each section. All information will be saved into 2 arrays ID[] and grade[].

Display option: Figure 10: Display option

  • Explain flowchart: In this flowchart, student information (including ID and grade) will be taken from the array entered in the previous function. then create counter variable i and start using loop. For each increase of i, the program will print the information of a corresponding element to the screen, repeating until all the elements in the array are passed.