0% found this document useful (0 votes)
276 views

Assignment 2: Date Received 1st Submission Re-Submission Date Date Received 2nd Submission

The program allows users to input a list of students with ID, name, and grade. It stores the student information in a struct. Users can enter multiple students at once based on a given number, or single students one by one. The program displays the full student list and finds the student with the highest and lowest grades. It includes functions for input, output, and searching the student data.

Uploaded by

Hung Ho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
276 views

Assignment 2: Date Received 1st Submission Re-Submission Date Date Received 2nd Submission

The program allows users to input a list of students with ID, name, and grade. It stores the student information in a struct. Users can enter multiple students at once based on a given number, or single students one by one. The program displays the full student list and finds the student with the highest and lowest grades. It includes functions for input, output, and searching the student data.

Uploaded by

Hung Ho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

ASSIGNMENT 2

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title PROG102: Procedural Programming

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Ho Tran Minh Hung Student ID GCD19899

Class GCD0904 Assessor name Phan Thanh Tra

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

1|Page
 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:


Lecturer Signature:

2|Page
TABLE OF CONTENTS
P4. Task 1: Program implements the designed solution..............................................................................5
1 Library function declaration..................................................................................................................5
2 Struct declaration.................................................................................................................................5
3 The student’s ID information input.......................................................................................................5
4 The student’s Name information input.................................................................................................6
5 The student’s Name information input.................................................................................................6
6 Enter list of students from given number of students..........................................................................6
7 Enter single student to the list of students...........................................................................................7
8 Display list of students..........................................................................................................................7
9 Finding the student have highest grade...............................................................................................8
10 Finding the student have lowest grade..............................................................................................8
11 Menu design, call the function and sort the function by item...........................................................9
P5 Task 2. TEST CASE.................................................................................................................................10
1 Input list of students from given number of students........................................................................10
2 Input single students to the list..........................................................................................................11
3 Display list of students........................................................................................................................11
4 Find a student having the highest grade.............................................................................................12
5 Find a student having the lowest grade..............................................................................................12
6 Exit the Program.................................................................................................................................13
Task 3 TEST PLAN OF SCENARIO PROGRAM..............................................................................................14
Task 4. REVIEW AND EVALUATE THE DESIGN............................................................................................16
Advantages:...........................................................................................................................................16
Disadvantages:......................................................................................................................................16
INDEX OF COMMEMT................................................................................................................................17

3|Page
TABLE OF FIGURES
Figure 1: Library Function declaration.........................................................................................................5
Figure 2: Struct declaration.........................................................................................................................5
Figure 3: The student’s ID information input...............................................................................................5
Figure 4: The student’s Name information input.........................................................................................6
Figure 5: The student’s Name information input.........................................................................................6
Figure 6: List of students from given number of students...........................................................................6
Figure 7: Enter single student to the list of students...................................................................................7
Figure 8: Display list of students..................................................................................................................7
Figure 9: The student have highest grade...................................................................................................8
Figure 10: The student have lowest grade...................................................................................................8
Figure 11: Menu design, call the function and sort the function by item....................................................9
Figure 12: Input list of students from given number of students function................................................10
Figure 13: Input single students to the list function..................................................................................11
Figure 14: Display list of students function................................................................................................11
Figure 15: Find a student having the highest grade function.....................................................................12
Figure 16: Find a student having the lowest grade function......................................................................12
Figure 17: Exit the Program function.........................................................................................................13

4|Page
P4. Task 1: Program implements the designed solution.
1 Library function declaration

Figure 1: Library Function declaration


<stdio.h>: Provides the core of the input capabilities in C.

<string.h>: To accommodate a variety of character ranges.

2 Struct declaration

Figure 2: Struct declaration


Struct defines the structure of the student including the student's id, name, and grade.

In which the student's name is up to 30 characters.

3 The student’s ID information input

Figure 3: The student’s ID information input


This is where the input IDs of all students are entered and stored.

This is also where the student ID number will be printed.

Student ID must be between 100 and 999.

5|Page
4 The student’s Name information input

Figure 4: The student’s Name information input


This is where the names of all students are entered and stored.

This is also where the student's name will be printed on the screen.

The condition of this line of code is to enter 10 characters or more and a maximum of 30 characters.

5 The student’s Name information input

Figure 5: The student’s Name information input


This is where all students' scores are received and stored.

This is also where student grades will be printed on the screen.

Student's score when entered is limited from 0 to 10.

6 Enter list of students from given number of students

Figure 6: List of students from given number of students


This is where the student list will be entered.

6|Page
Large amounts of student information can be entered at once.

7 Enter single student to the list of students

Figure 7: Enter single student to the list of students


Here we can enter information single student to the list of students.

Besides, there is an additional line Continous to help add single student information whenever you
want.

8 Display list of students

Figure 8: Display list of students


Here will store and display student information according to the entered list.

7|Page
9 Finding the student have highest grade

Figure 9: The student have highest grade


Here the system will find and display the information of the student with the highest grade.

10 Finding the student have lowest grade

Figure 10: The student have lowest grade


Here the system will find and display the information of the student with the lowest grade.

8|Page
11 Menu design, call the function and sort the function by item

Figure 11: Menu design, call the function and sort the function by item
This is the menu of the program with many necessary choices.

Here we will enter from 0 to 5 to be able to select the part we want to enter in the program.

9|Page
P5 Task 2. RUN THE PROGRAM
1 Input list of students from given number of students

Figure 12: Input list of students from given number of students function

10 | P a g e
2 Input single students to the list

Figure 13: Input single students to the list function

3 Display list of students

Figure 14: Display list of students function

11 | P a g e
4 Find a student having the highest grade

Figure 15: Find a student having the highest grade function

5 Find a student having the lowest grade

Figure 16: Find a student having the lowest grade function

12 | P a g e
6 Exit the Program

Figure 17: Exit the Program function

13 | P a g e
Task 3 TEST PLAN AND TEST CASE OF SCENARIO PROGRAM
Project Name: Student management program.

Created by: Ho Tran Minh Hung

Date of creation:20/6/2021

Date of review:23/6/2021

3.1 Test Plan

Test Name Task Description Start Date End Date Estimated Efforts Notes
(Hrs./Days)
Test choice from try to choose a 22/6/2021 23/6/2021 1
Menu number that is out of
user choice.
Test Input ID student try to choose any 22/6/2021 23/6/2021 1
number that is not
between 100 and
999.
Test input student Try entering as many 22/6/2021 23/6/2021 1
name characters as the
condition allows.
Test grade as real Try entering real 22/6/2021 23/6/2021 1
munber numbers in the range
0 to 10
Test ID as character Try entering 22/6/2021 23/6/2021 1
character in ID
Test grade as Try entering 22/6/2021 23/6/2021 1
character character in grade

3.2 Test case

Test Test case prerequisite Test Inpu Expecte Actual output Status
cas objective step t d output Pass/Fai
e ID data l
Test Enter 0<=User 1. 6 Please Pass
cas choice Choice=<5 Enter choose
e1 from Choice again
Menu >5 2.
Enter

Test Input 100<=ID<=99 1. 50 First - Pass


cas student 9 Enter Enter
e2 ID ID Student
number 2. ID:
lower Enter
than 100
inside ID
variable

Test Input String 1.Ente Ho Ho Tran Pass


cas student leng>10; r name Tran Minh
e3 name String 2. Min Hung
leng<30 Enter h
Hun
g
Test Enter 0<Grade<10 1. 7 7.0 Pass
cas grade as Enter
e4 real Grade
number 2.Ente
r
Test Enter Id 100<=ID<=99 1. H First - Fail
cas as 9 Enter Enter
e5 character ID Student
2. ID:
Enter

14 | P a g e
Test Enter 0<Grade<10 1. M Third - Fail
cas Grade As Enter Enter
e6 Characte Grade Student
r 2.Ente Grade:
r

15 | P a g e
Task 4. REVIEW AND EVALUATE THE DESIGN
Advantages:
-The program runs very well

-The input and output data are good, not missing, and have no particular errors.

-The test results of the program are the same.

-Enter the wrong ID type (100 to 999), the program will start re-entering

Disadvantages:
-This program still lacks some functions to delete students, sort the list of students and return when the
wrong function is selected.

- Issues where incorrect characters are entered in a student's ID entry or a student's grade causes the
software to fail to be restarted.

Based on the above I will try to fix, perfect and enhance the existing and missing functions.

16 | P a g e
INDEX OF COMMEMT

17 | P a g e

You might also like