










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 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 progr
Typology: Assignments
1 / 18
This page cannot be seen from the preview
Don't miss anything!











Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 0 : Procedural Programming
Submission date 05/03/2021 Date Received 1st submission
Re-submission Date 09/03/2021 Date Received 2nd submission
Student Name Tran Minh Quan Student ID GCH
Class GCH0905 Assessor name Nguyen Dinh Tran Long
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 Quan
Grading grid
Grade: Assessor Signature: Date:
Lecturer Signature:
a. Definition:
To writing guideline for computer to run one or more tasks, computer Programming
Languages is known as special languages designed for programmers. It defines a set of coding
rules so that can help programmers to create guidelines for carry out computer tasks. Different
programming languages have their own rules. (Anon., 2021)
Figure 1 - Computer Programming Languages
b. Classification of Programming Languages:
It is the programming language with powerful abstraction which gets from software
information. When the programmers use these applications, they can generate the program
without permission of detailed layout of the particular machine which runs its program.
It means that the programmers do not need to study computer design and take notice of
solving the problems. Due to this, they are also called Problem-Oriented Languages.
Examples: C, C++, JAVA,… (Anon., 2009)
It is the programming language with non-powerful abstraction. The programmers need to
study carefully about computer design due to deep understanding of computer layout that for
composing the program for such a computer. Not like High-level Languages, the Low-level
Languages programs are only for one main computer. As a result, Low-level Languages is
less popular than High-level Languages.
Examples: Assembly Language, Machine Language,… (Anon., 2009)
Figure 4 - Java Language
Figure 5 - Python Language
Procedural Programming will split a program into smaller procedural blocks when each block has
its own private data and logic. The procedurals do not work jointly, they are independent and the
information will be exchange through arguments and return values.
Procedural Programming goes with definition of functions, procedurals, parameters and
arguments,…
Programmers can observe a program obviously through its functions in spite of any details. It is
extremely important as it will help solving serious problems become more easily and exactly.
(Tanaka, 2012)
Figure 6 - Procedural Programming
Figure 7 - Code example of “Switch case”
With this function, my program can have more functions that users need to do with their
information, such as finding the highest mark and who has that.
b. “If” statement function:
and make decision about which code block to be executed. In my program, “if” statement
is used to find the highest or the lowest mark in memory that users have already inputted.
Figure 8 - Code example of “If”
In this example, min is known as the lowest mark that we need to find out. If min is higher
than one element (the condition is true), min will get a new value and this new value is equal
to that element.
a. “For” loop syntax:
is true, the program will continue and it only stops if condition is false.
Due to this, we can compare “max”, “min” with every element in memory.
Figure 9 - Code example of “For”
In this example, we compare “min” with each element grades in array and we will get the
lowest value of grade, which is known as min, after this function.
b. “Do… while” and “while” statement:
same principle, which is repeated many actions with one condition. With them, program will
re-do the actions again and again until the condition returns false. However, the order of their
taking steps run differently.
checking the condition. Otherwise, the condition will be checked first then do the actions in
“While” statement.
in both statements “Do… While” and “While”. However, we will clearly see the different
between these two, if we give wrong condition in the first implementation. Truly, with
“While” statement, program will not do anything and exits immediately. But in “Do…
while”, program still does the given actions one time then break to exit iteration constructs.
users and do variety of actions until getting right information.
Figure 10 - Code example of "Do... while"
In this example, “Do… while” statement persuades users enter input number of students. If
users enter a character, the condition is true (Checknum(n) is function that checks input as
an integer and this condition is check input as not an integer) and this statement still happens.
It means that users have to enter input again and again until their input is an integer.
Diagram 2 - Use case Diagram
Diagram 3 - Menu Flowchart
Diagram 5 - Find highest grade Flowchart
› Step 1: Start.
› Step 2: Declare float grades[50], int IDs[50], i, maxID, max.
› Step 3: Check the condition “i < n”:
› Step 4: Check the condition “max < grades[i]”:
› Step 5: Increment i by +1 then repeat step 3.
› Step 6: End.
Diagram 6 - Find lowest grade Flowchart
› Step 1: Start.
› Step 2: Declare float grades[50], int IDs[50], i, minID, min.
› Step 3: Check the condition “i < n”:
› Step 4: Check the condition “min > grades[i]”:
› Step 5: Increment i by +1 then repeat step 3.
› Step 6: End.