

















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
This AS was got an DISTINTION GRADE.
Typology: Assignments
1 / 25
This page cannot be seen from the preview
Don't miss anything!


















Unit Number and Title Unit 0: IT Fundamental & Procedural Programming Academic Year 2021 Unit Tutor Ho Nguyen Phu Bao Assignment Title Analysis and Design a solution for procedural programming problem Issue Date Submission Date IV Name & Date Vo Minh Tri 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 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. Task 1 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. Task 2 Your next task is to do the analysis for the scenario mentioned above by doing the following subtasks
Figure 1 - Programming Language ........................................................................................... 3 Figure 2-ENIAC..................................................................................................................... 4 Figure 3 - Programming Languages Ranking (Source: www.tiobe.com) ........................................ 4 Figure 4 - Code Python ........................................................................................................... 5 Figure 5- Example of Procedural Programming ......................................................................... 5 Figure 6- Hello Word in C language ......................................................................................... 6 Figure 7- Global Variable and Local Variable ........................................................................... 7 Figure 8- Another Libraries ..................................................................................................... 7 Figure 9 - : Data types in C language (Mishra, 2021).................................................................. 9 Figure 10 - Variables and Data types in this program ............................................................... 10 Figure 11 - Example for using "if" statement function ............................................................. 10 Figure 12 - Example of using "if-else" statement functio.......................................................... 11 Figure 13 - Hierarchy diagram program ............................................................................. 12 Figure 14 - Example of using "switch case" statement function ......................................... 13 Figure 15 - Example of using "for" statement function ....................................................... 14 Figure 16 - Example of using "Do-while" statement function ............................................. 15
Diagram 1 - Use Case Diagram .............................................................................................. 16 Diagram 2- Input Students ..................................................................................................... 17 Diagram 3 - Menu control ...................................................................................................... 18 Diagram 4-Student Rankings ................................................................................................. 19 Diagram 5-Find Max Grade ................................................................................................... 20 Diagram 6- Find Min Grade .................................................................................................. 21
This is the first time I doing an assignment but I will try my best to get an M grade. With the development of social, nowadays, the application of technology is becoming more and more popular. Therefore, it requires students of information technology to improve their knowledge even more. However, to build a solid house, you need a solid foundation. That's why Procedural Programming (PROG102) is a very important subject for an information technology student like me. This course has helped me to understand more deeply about the components of the computer such as CPU, RAM, ROM; Learn more about system numbers like Octal, Hexadecimal and how to convert between system numbers. Also, I know more about how an operating system works. The most special is the C programming language. Although it is an old language, it has helped me understand the steps to solve problems, the syntax, and loops in programming, ... Here It's a huge step for me to learn more about programming in the future. In assignment, I will perform 3 chapter
Chapter 1: I will introduce programming languages, procedural programming. And the main functions of procedural programming. Chapter 2: I will present the libraries, variables, statements, and loops that I plan to use in the program and explain how I intend to use them. Chapter 3: I will present the flowchart, work breakdown structure and use case diagram I will use in the program about interpreting them with Pseudo code. Chapter 1: Procedural Programming and Programming Languages (P1, M1) 1.1 What is Programming Language? From time immemorial, when humans first appeared on earth, they created language to communicate with each other. Language is used to express one's meaning and feelings towards others, through which people understand each other. As people developed, they also began to create languages that were not used for normal communication, but a way for them to "communicate" with computers. Programming language is a tool we use to create a program for the computer so that the computer follows instructions and produces the results that the programmer wants. The computer will process the programming language in binary form and output the result in the same form. Programming languages will help us translate from binary code to an output that we humans can understand. A programming language is made up of lots of statements, loops, functions, strings, arrays, external libraries and symbols that act as connectors that allow humans to translate our thoughts into instructions that the computer can understand. (Team, 2021) Figure 1 - Programming Language The year 1946 when the first computer ENIAC (Electronic Numerical Integrator and Computer) was also a big turning point in the history of human development. Soon after, a series of programming languages were born. Up to now, when people are entering the era of computers, of the 4.0 era with technology being a great driving force to boost the economy. Programming languages. Concepts like blockchain bigdata or artificial intelligence were also born to serve that purpose. To meet those needs, programming languages must increasingly be easier to understand so that programmers can use them fluently, but also need to meet the complex requirements of the digital economy.
1.2 Procedural Programing
Procedural Programming (POP) is the first basic programming paradigm a new programmer will learn. Essentially, procedural programming is code that directly instructs a device how to complete a task in sequential order. Flowchart of the program's control flow organization. Procedural programming divides the program into functions if the program is too large. A function is simply a subroutine containing a series of steps to be performed. In a nutshell, Procedural Programming is writing a list of instructions for the computer to understand what it must do to complete the task required by the programmer. (Bhatia, 2021) Figure 5 - Example of Procedural Programming Figure 4 - Code Python
Procedural or Procedure Oriented Programming (POP): As the name implies, Procedure Oriented Programming contains step by step procedure to execute. Here, the problems get decomposed into small parts and then to solve each part one or more functions are used. Thus in POP approach, the problem is viewed as a sequence of things to be done, such as, input taking, calculating and displaying. The primary focus stays on functions which will be used to accomplish each task. Main Characteristics of POP: Following are the found main characteristics of POP,
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. First, we need to generalize the requirements of the scenario as follows:
A data type defines certain characteristics of data used in a software program and tells the compiler about predefined properties required for a particular variable or related data object. (Techopedia, 2021) Figure 9 - : Data types in C language (Mishra, 2021) Names Data Types Description IDs Int ID of student Grades Float The grades of student N Int The maximum students input in program Current Int The number of student current Choices Int Reporting options that users choose Max Float The highest grades of student Min Float The lowest grades of student The following table shows data about these variables, which I will use this program, including their names, data types and its description.
Figure 13 - Hierarchy diagram program
2.3. Loop statement
Figure 16 - Example of using "Do-while" statement function 2.4. Functions
3.2 Flowcharts As mentioned above to be able to understand more about the guessing algorithms behind the program's functions, we need to add flowcharts to be able to better understand that. To be able to explain in detail, I will have 6 flowcharts to explain the problems of: Enter student number, enter student's grade and name, menu control, student rankings, find max grade and find min grade. 3.2.1 Input number student To be able to enter the number of students, we need to have an indispensable condition that the number of students must be greater than zero. Because there cannot be a single student or the number of students is negative. Here is my diagram: Diagram 2 - Input Students As you can see when the program starts running, the program will ask the user to enter n (n is the number of students to manage). After the user has finished entering, the program will check the condition (n >=0). If this condition is true, the program will string Name student and two array
grade student and id student. If the condition is false, the program will print to the screen "n is not available" and ask the user to re-enter until n true with the condition, then it will end.
After we have the number of students to manage, next we need the user to enter their scores in turn. Of course, there will also be a and condition with the name and score so that errors can be avoided when creating the table. In which the score of the student entered must be less than 0 and greater than 10. The character limit of the student’s name is from 4-23 characters and only includes alphanumeric characters and space characters.
To create a control menu for the program, we must include the menu in the switch-case statement and nest it in the do-while loop. In addition to being able to exit the loop, we also need an option so that the option matches the condition of the "while:" statement in the do-while loop. And here is my schematic: Diagram 3 - Menu control