Procedural Programming: An Illustrated Guide for Managing Grades - Prof. Le Ngoc, Cheat Sheet of Systems Design

An illustrated guide on procedural programming, with a focus on managing grades for a class. It includes an introduction to procedural programming, key features, data types, statements, and design diagrams. The guide also covers the use of arrays for storing student IDs and grades, finding the highest and lowest grades, and evaluating the design.

Typology: Cheat Sheet

2019/2020

Uploaded on 10/05/2022

duy-trung
duy-trung 🇻🇳

1 document

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Assignment 1 : Analysis and Design a
solution for procedural programming
problem
Student’s name : Bui Duy Trung
Id : GCS210515
Class : GCS1003B
Instructor : Le Ngoc Thanh
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Procedural Programming: An Illustrated Guide for Managing Grades - Prof. Le Ngoc and more Cheat Sheet Systems Design in PDF only on Docsity!

Assignment 1 : Analysis and Design a

solution for procedural programming

problem

Student’s name : Bui Duy Trung

Id : GCS

Class : GCS1003B

Instructor : Le Ngoc Thanh

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:

Lecturer Signature:

Assignment Brief 1 (RQF)

Higher National Certificate/Diploma in Computing

Unit Number and Title Unit 0: IT Fundamental & Procedural Programming Academic Year 2021 Unit Tutor Assignment Title Analysis and Design a solution for procedural programming problem Issue Date Submission Date 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

Catalog Assignment 1 : Analysis and Design a solution for procedural programming problem........................... 1 ASSIGNMENT 1 FRONT SHEET................................................................................................................... 3 Assignment Brief 1 (RQF)........................................................................................................................... 5 P1 , M1....................................................................................................................................................... 8 1 Introduction :.......................................................................................................................................... 8 1.1 What is procedural programming? ( P1 ) According to Wikipedia, procedural programming is possibly the first programming paradigm a new developer will learn. Essentially, procedural code is code that directly instructs a device how to complete a task in logical steps. This model uses a top-down linear 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, also known as routines or functions, which simply contain a series of steps to be performed.............. 8 1.2 Key Features of Procedural Programming ( M1 )........................................................................ 8 1.3 Application................................................................................................................................... 8 2 Analyse :.................................................................................................................................................. 9 2.1 Data types.................................................................................................................................... 9 2.2 Local variables and global :.......................................................................................................... 9 2.4 Statements................................................................................................................................. 10 P3, M2...................................................................................................................................................... 13 3 Design.................................................................................................................................................... 13 3.1 What’s WBS............................................................................................................................... 13 3.2 What’s flowchart ?..................................................................................................................... 14 D1............................................................................................................................................................. 19 4 Evaluation.............................................................................................................................................. 19 4.1 Overview my solution :.............................................................................................................. 19

  • Looking at the design direction, the way to solve the problem transmitted through the above diagram is relatively acceptable, it is not perfect because in my opinion during the programming phase there can be a lot of confusing problems. But my approach succeeds in solving the problem relatively stable................................................................................................................. 19 4.2 Advantages and Disadvantages :............................................................................................... 19
  • Procedural programming helps me to solve the problem relatively easily because it possesses basic features such as the operation of the program in a top-down sequence, which makes it easy and convenient to control the source of information. benefits in breaking down program parts into functions to solve problems............................................................................................ 19 5 References............................................................................................................................................. 19
P1 , M

1 Introduction : 1.1 What is procedural programming? ( P1 ) According to Wikipedia, procedural programming is possibly the first programming paradigm a new developer will learn. Essentially, procedural code is code that directly instructs a device how to complete a task in logical steps. This model uses a top-down linear 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, also known as routines or functions, which simply contain a series of steps to be performed. Simply put, Procedural Programming involves writing down a list of instructions to tell the computer what to do step by step to complete the task at hand. 1.2 Key Features of Procedural Programming ( M1 )

  • Procedural programming follows a top-down approach.
  • The program is divided into blocks of codes called functions, where each function performs a specific task.
  • Procedural programs model real-world processes as 'procedures' operating on 'data'.
  • The data and functions are detached from each other.
  • The data moves freely in a program.
  • It is easy to follow the logic of a program.
  • A function can access other function's data by calling that function. 1.3 Application
  • Procedural programming languages break up the programming task into a number of procedures (also sub-routines or functions). Each procedure carries out a specific task and is called from the main program. The procedural approach is relatively easy to understand and is therefore often used when first learning programming. It is also suitable for systems that are fairly straightforward and don’t involve many different interacting sub-systems.
  • Procedural programming is specific to calculating scientific and engineering uses. It is used for calculations. It consists of a fluid movement throughout the program as it runs. This is great for straightforward systems which don’t involve many different interacting sub-systems.

2.4 Statements

  • Alternatively known as a conditional expression, conditional flow statement, and conditional processing, a conditional statement is a set of rules performed if a certain condition is met. It is sometimes referred to as an If-Then statement, because IF a condition is met, THEN an action is performed. The required construction for the solution :
    • If-else structures means conditional for statements, expression and constructs. Specifically, conditionals perform different computations or actions depending on whether a programmer-defined condition evaluates to true or false. If-else Structures use to test in certain condition and make decision about which code block need to be executed. If-else Structures to find the student have lowest grade the same with student have highest grade with the condition is : the student in the current loop have grade lower than the grade of student in the previous loop, then returns the student with the lower grade in current loop.
  • Switch-case statement, switch statements function somewhat similarly to the if statement, exists in most high-level imperative programming languages.
  • Switch-case structures use to design a menu options for user to help them determined what function in program they want to use. The switch case is used when we have multiple options and we want to compared the input value with all the cases inside the switch..case block to execute different options.
  • The for statement lets you repeat a statement or compound statement a specified number of times. The body of a for statement is executed zero or more times until an optional condition becomes false. You can use optional expressions within the for statement to initialize and change values during the for statement's execution. For helps us to display all student user add and find the students with the highest and lowest scores. The initialization statement is executed three times.
  • A while loop in C programming repeatedly executes a target statement as long as a given condition is true. Here, statements may be a single statement or a block of statements. The condition may be any expression, and true is any nonzero value. The loop iterates while the condition is true.

When the condition becomes false, the program control passes to the line immediately following the loop.

P3, M

3 Design 3.1 What’s WBS

  • Arcording to Wikipedia, “Use Case Diagram is a representation of a user's interaction with the system that show the relationship between the use and the different use cases in which the user is involved” (Anon.).
  • The benefits of creating a WBS include: it defines and organizes the work required. it facilitates the quick development of a schedule by allocating effort estimates to specific sections of the WBS. it can be used to identify potential scope risks if it has a branch that is not well defined.

3.2 What’s flowchart?

  • A flowchart is a diagram that depicts a process, system or computer algorithm. They are widely used in multiple fields to document, study, plan, improve and communicate often complex processes in clear, easy-to-understand diagrams. 3.2.1 Organizational chart
  • A diagram that shows the structure of an organization and the relationships and relative ranks of its parts and positions/jobs. The term is also used for similar diagrams, for example ones showing the different elements of a field of knowledge or a group of languages
  • The diagram above take the work of breaking down the pieces of work that the program needs to do in an easy to understand, logical way by WBS
  • Flowchart above illustrate step-by-step how to input variables in to arrays using loop. First, we start a loop that brings the input statement into the previously created information arrays until the number of times the loop is equal to the number of students we need to enter the information. 3.2.4 Find the student with lowest grade :
  • I give the first value in the array equals min, start the loop with conditional statement to find the smaller value in the array, the loop will be stopped when the minimum value is found and print it

3.2.5 Find the student with highest grades :

  • The same to the way to find the student with lowest grades, but with a little bit different with the condition of the loop, find the greater value in the array then print it out ( Display on the screen ). 3.2.6 Display the list of student :
D

4 Evaluation 4.1 Overview my solution :

  • Looking at the design direction, the way to solve the problem transmitted through the above diagram is relatively acceptable, it is not perfect because in my opinion during the programming phase there can be a lot of confusing problems. But my approach succeeds in solving the problem relatively stable 4.2 Advantages and Disadvantages :
  • Procedural programming helps me to solve the problem relatively easily because it possesses basic features such as the operation of the program in a top-down sequence, which makes it easy and convenient to control the source of information. benefits in breaking down program parts into functions to solve problems
  • My program still missing a lot of things, it will be very inconvenient if this program is used for a class with too many students, making the declaration take a lot of time. Your program can still be upgraded such as creating accounts, passwords for users, storing personal information, notifications of each account 5 References En.wikipedia.org. 2022. Procedural programming - Wikipedia. [online] Available at: https://en.wikipedia.org/wiki/Procedural_programming [Accessed 20 February 2022] KnowledgeBoat. 2022. What are the characteristics of procedural programming?|KnowledgeBoat. [online] Available at: https://www.knowledgeboat.com/question/what-are-the-characteristics-of- procedural-programming-- 28311496451138200 [Accessed 20 February 2022] Tutorialspoint.com. 2022. C - Data Types. [online] Available at: https://www.tutorialspoint.com/cprogramming/c_data_types.htm [Accessed 20 February 2022] Docs.microsoft.com. 2022. Overview of C Statements. [online] Available at: https://docs.microsoft.com/en-us/cpp/c-language/overview-of-c-statements? view=msvc-170#:~:text=C%20statements%20consist%20of%20tokens,is%20discussed%20in%20this %20section. [Accessed 20 February 2022]. Programiz.com. 2022. C for Loop (With Examples). [online] Available at: https://www.programiz.com/c-programming/c-for-loop [Accessed 20 February 2022]. En.wikipedia.org. 2022. Work breakdown structure - Wikipedia. [online]

Available at: https://en.wikipedia.org/wiki/Work_breakdown_structure [Accessed 20 February 2022]. En.wikipedia.org. 2022. Flowchart - Wikipedia. [online] Available at: https://en.wikipedia.org/wiki/Flowchart [Accessed 20 February 2022]. Cuemath. 2022. Conditional Statement - Cuemath. [online] Available at: https://www.cuemath.com/data/conditional-statement/ [Accessed 20 February 2022]. Career Karma. 2022. What is Procedural Programming, and When Should You Use It?. [online] Available at: https://careerkarma.com/blog/procedural-programming/#:~:text=When%20you%20use %20a%20procedural,from%20a%20top%2Ddown%20view. [Accessed 20 February 2022]. Programiz.com. 2022. C while and do...while Loop. [online] Available at: https://www.programiz.com/c-programming/c-do-while-loops [Accessed 20 February 2022].