Higher Nationals in Computing
Unit 0: Procedural Programming
ASSIGNMENT 2
Learner’s name: lê đặng đan duy
ID: gcs210811
Class: GCS1005C
Subject code: PROG102
Assessor name: PHAN MINH TAM
Assignment due: Assignment submitted:
ASSIGNMENT 2 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 0: IT Fundamental & Procedural Programming
Submission date Date Received 1st submission
Re-submission Date Date Received 2nd submission
Student Name Lê đặng đan duy Student ID Gcs210811
Class GCS1005C Assessor name Phan Minh Tam
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
P4 P5 M3 M4 D2
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date:
Signature & Date:
ASSIGNMENT 2 BRIEF
Unit Number and Title Unit 0: IT Fundamental & Procedural Programming
Academic Year 2021
Unit Tutor
Assignment Title Assignment 2: Write a program and test
Issue Date
Submission Date
IV Name & Date
Learning Outcomes and Assessment Criteria
Pass Merit Distinction
LO3 Be able to implement procedural programming solutions
LO4 Be able to test procedural programming solutions
P4 Write a program that M3 Program is written following D2 Evaluate your program,
implements the designed solution. coding standards, input data are state lessons learnt and future
validated improvements.
P5 Test the program with proper M4 Analyse test results for future
test plan. maintenance.
Assignment Brief
Scenario: Please refer to scenario in Assignment 1.
Tasks 1
Your next task is to implement the software that you designed in previous steps. You need to implement the
software designed in assignment 1 using C programming language. Your code must make use of programming
standards, including file headers and effective code commenting. You need to provide screenshots of your
program when running. During the development of your program, if you make any changes to the original
design, state them with reasons in report. Your code listings must be included as an appendix.
Task 2
Test your program by making a test plan, execute it and log results. Your test plan should include data validation
and program operations based on requirements. Test results (passed or failed) should be analysed to help the
program in future maintenance.
Task 3
Write an evaluation and conclusion of the whole development. The evaluation of your program should be based
on its running and its test result. You should mention about lessons learnt and future improvement.
A final report of these 3 tasks must be submitted in PDF format to CMS.
Submission Format
The submission is in the form of a Word document. You are required to make use of appropriate structure,
including headings, paragraphs, subsections and illustrations as appropriate, and all work must be supported
with research and referenced using the Harvard referencing system.
Table of Contents
Unit 0: Procedural Programming ASSIGNMENT 2 ............................................................................................... 1
P4. Write a program that implements the designed solution. ............................................................................ 1
Scenario.............................................................................................................................................................. 1
1. You need to implement the software design in assignment 1 using programming language. ................ 1
2. Explanation about each Function in the programming code ................................................................... 4
2.1. int main()......................................................................................................................................... 4
2.2. Void addStudent() ........................................................................................................................... 5
2.3. Void showAll() ................................................................................................................................. 6
2.4. Float findHighestGrades() ............................................................................................................... 6
2.5. Float findLowestGrades() ................................................................................................................ 6
3. Run application ....................................................................................................................................... 7
3.1. Show The Menu .............................................................................................................................. 7
3.2. Add a New Student Feature ............................................................................................................ 8
3.3. Show All Student ............................................................................................................................. 8
3.4. Print The Highest Grade .................................................................................................................. 9
3.5. Print the Lowest Grade.................................................................................................................... 9
3.6. Exit Application ............................................................................................................................. 10
P5. Test the program with the proper test plan ............................................................................................... 10
REFERENCES ..................................................................................................................................................... 12
ASSIGNMENT 2 ANSWERS
P4. Write a program that implements the designed solution.
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.
Tasks 1
Your next task is to implement the software that you designed in previous steps. You need to implement
the software designed in assignment 1 using C programming language. Your code must make use of
programming standards, including file headers and effective code commenting. You need to provide
screenshots of your program when running. During the development of your program, if you make any
changes to the original design, state them with reasons in report. Your code listings must be included
as an appendix.
Task 2
Test your program by making a test plan, execute it and log results. Your test plan should include data
validation and program operations based on requirements. Test results (passed or failed) should be
analysed to help the program in future maintenance.
Task 3
Write an evaluation and conclusion of the whole development. The evaluation of your program should
be based on its running and its test result. You should mention about lessons learnt and future
improvement
1. You need to implement the software design in assignment 1 using programming
language.
P age |1
P age |2
P age |3
2. Explanation about each Function in the programming code
2.1. int main()
P age |4
Explanation: At this function called addStudent. It lets the user type in the data for a new
student. This new Student is added to the top of the list. It’s next point at the old top the list.
2.2. Void addStudent()
P age |5
Explanation: In this function, the program allow to show for the users know all the
informations include the ID, Name and the Grades of all the students were stored in Array
which we inputed in the before step.
2.3. Void showAll()
Explanation: In this function, the program will show all the student in the list I created
2.4. Float findHighestGrades()
Explanation: In this function , the program is going to find the highest grades in the list of
student
2.5. Float findLowestGrades()
P age |6
Explanation: in this function, the program is going to find the lowest grades in the list of
student
2.6 void printHighestGrades()
Explanation: in this function, the program will be show the student who have the highest
grades
2.7 void printLowestGrades()
Explanation: In this function, the program will be show the student who have the lowest
grades
3. Run application
3.1. Show The Menu
P age |7
3.2. Add a New Student Feature
3.3. Show All Student
P age |8
3.4. Print The Highest Grade
3.5. Print the Lowest Grade
P age |9
3.6. Exit Application
P5. Test the program with the proper test plan
Implement the test plan for my software
Test plan template
Test What is being tested Expected outcome Actual Outcome Pass or Fail
Number
1 Select number 1 from Display screen to Ask the users input PASS
the menu allow input ID and the student ID and
Grade Grades
2 Input ID = 1 Store ID, Name and ID = 1, Student’s PASS
Input Name: le dang dan Grade into Array Name = le dang dan
duy duy and the grade =
Input Grade= 10.0 10.0 were stored
into array
3 Input ID = 3 Store ID, Name and ID = 3, Student’s PASS
Input Name: Tran Van Grade into Array Name = a and the
Loc grade = 8.0 were
Input Grade = 7.0 stored into array
P a g e | 10
4 Select number 2 from Display screen to It show all the ID FAIL
the menu show all the and Name of all
student who are students stored in
inputted into Array but the Grade
before just print 0
5 Select number 2 from Display screen to Show all the PASS
the menu show all the existent student
student who are include the ID, the
inputted into Name, the Grades
before in the program
6 Select number 3 from Display into the It showed exactly FAIL
the menu screen about the the lowest grade
information’s but it’s wrong
student has the about the
lowest grade information’s
student
7 Select number 3 from Display into the It print the Grade is FAIL
the menu (The second screen about the null number
time) information’s (especially it show
student has the The Lowest Grade =
lowest grade 0)
8 Select number 4 from Display into screen Instead of showing FAIL
the menu the highest grade of the highest grade, it
student just showed the
grade of the first
student
9 Select number 4 from Display into screen It just only showed FAIL
the menu ( The second the highest grade of the grade of the
time) the student second student
10 Select number 4 from Display into screen It print the Grade is FAIL
the menu ( The third the highest grade of null number
time) the student (especially it show
The Highest Grade
= 0)
11 Select number 4 from Display into screen It showed exactly PASS
the menu ( The four the highest grade of about the
time) the student information’s
student has the
highest grade in all
student.
P a g e | 11
12 Select number 5 from Display into screen It just showed back FAIL
the menu process exited the menu of the
options
13 Select number 5 from Display into screen Finishing the PASS
the menu (The second process exited process of the
time) program
14 Select any option Display into the It printed “Invaid PASS
(except 1 to 5) screen invaid Option, Please
option Input Option Again”
15 Select number 4 from Display into screen Instead of showing PASS
the menu the highest grade of the highest grade, it
student just showed the
grade of the first
student
Select number 3 from Display into screen Show the highest FAIL
16 the menu the highest grade grade student
17 Select number 3 from Display into screen Show the highest PASS
the menu(the second the highest grade grade student
time)
18 Select number 4 from Display into screen Show the lowest FAIL
the menu the lowest grade grade student
19 Select number 4 from Display into screen Show the lowest PASS
the menu(the second the lowest grade grade student
time)
20 Select number 4 from Display into screen Show the source PASS
the menu “press any key to code
continue”
REFERENCES
Bhardwaj, P.(2022). ‘cprogramming’. [online] tutorialspoint Available at:
https://www.tutorialspoint.com/cprogramming/if_statement_in_c.htm# [Accessed 1 June.2022]
Bhardwaj, P.(2022). ‘cprogramming’. [online] tutorialspoint Available at:
https://www.tutorialspoint.com/cprogramming/if_else_statement_in_c.htm [Accessed 1 June.2022]
P a g e | 12
Bhardwaj, P.(2022). ‘c-switch-case-statement. [online] tutorialspoint Available at:
https://www.guru99.com/c-switch-case-statement.html [Accessed 3 June.2022]
Bhardwaj, P.(2022). ‘c_standard_library’. [online] tutorialspoint Available at:
https://www.tutorialspoint.com/c_standard_library/stdio_h.htm [Accessed 1 June.2022]
Bhardwaj, P.(2022). ‘c_standard_library’. [online] tutorialspoint Available at:
https://www.tutorialspoint.com/c_standard_library/string_h.htm [Accessed 1 June.2022]
Bhardwaj, P.(2022). ‘c_standard_library’. [online] tutorialspoint Available at:
https://www.tutorialspoint.com/c_standard_library/math_h.htm [Accessed 1 June.2022]
Lenka,C.(2022). ‘for-loop-with-examples’. [online] geeksforgeeks Available At:
https://www.geeksforgeeks.org/for-loop-with-examples/ [Accessed 1 June.2022]
Thompson, B(2022).’ c-programming-language’.[online] guru99 Available At:
https://www.guru99.com/c-programming-language.html [Accessed 1 June.2022]
D. and VandeKopple, J.J. (1997).’ ~dab’.[online] icarus.cs.weber Available At:
https://icarus.cs.weber.edu/~dab/cs1410/textbook/1.Basics/programs.html [Accessed
5 June 2022]
FITA (2015).’ phan-biet-cac-mo-hinh-phat-trien-phan-mem-chinh’.[online] procedural-
programming Available At: https://timoday.edu.vn/phan-biet-cac-mo-hinh-phat-trien-
phan-mem-chinh/procedural-programming/ [Accessed 5 June 2022]
FreeCodeCamp (2020). ‘news’.[online] format-specifiers-in-c Available At:
https://www.freecodecamp.org/news/format-specifiers-in-c/ [Accessed 5 June 2022]
P a g e | 13