Download Student Grade Management System and more Schemes and Mind Maps Hydraulics in PDF only on Docsity!
ASSIGNMENT 2 FRONT SHEET
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 Quang Minh Student ID GCD
Class GCD1104 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 D
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date:
Lecturer Signature:
- I. INTRODUCTION...............................................................................................................................................
- II. IMPLEMENTATION...............................................................................................................................................
- Structure of program
- 1.1 Library Declaration
- 1.2 Global Variable
- 1.3 Function prototypes
- 1.4 Function “main”
- 1.5 Function “Definition”
- Function
- 2.1 Function “Nhap ID Diem”
- 2.2 Function “in ID Diem”
- 2.4 Function “Diem Cao Nhat”
- 2.5 Function “Diem Thap Nhat”
- 2.6 Function “ID Diem Cao Nhat”
- 2.7 Function “ID Diem Thap Nhat”
- Importants Algorithms
- 3.1 Find MaxGrade
- 3.2 Find MinGrade
- 3.3 Find MaxID
- 3.4 Find MinID
- III. PROGRAM RESULTS (P4)................................................................................................................................
- IV. TESTING......................................................................................................................................................
- Figure 1 Library Declaration.........................................................................................................................................
- Figure 2 Global variable...............................................................................................................................................
- Figure 3 Prototypes.....................................................................................................................................................
- Figure 4 Display Menu.................................................................................................................................................
- Figure 5 Menu Option..................................................................................................................................................
- Figure 6 Function Definition........................................................................................................................................
- Figure 7 Nhap ID Diem.................................................................................................................................................
- Figure 8 in ID Diem....................................................................................................................................................
- Figure 9 Diem Cao Nhat.............................................................................................................................................
- Figure 10 Diem Thap Nhat.........................................................................................................................................
- Figure 11 ID Diem Cao Nhat.......................................................................................................................................
- Figure 12 ID Diem Thap Nhat.....................................................................................................................................
- Figure 13 Max Grade.................................................................................................................................................
- Figure 14 Min Grade..................................................................................................................................................
- Figure 15 MaxID.........................................................................................................................................................
- Figure 16 MinID.........................................................................................................................................................
- Figure 17 Program Menu...........................................................................................................................................
- Figure 18 Select Option 1...........................................................................................................................................
- Figure 19 Select Option 2...........................................................................................................................................
- Figure 20 Select Option 3...........................................................................................................................................
- Figure 21 Select Option 4...........................................................................................................................................
- Figure 22 Select Option 5...........................................................................................................................................
- Figure 23 Select Option 6...........................................................................................................................................
- Figure 24 Select Option 7...........................................................................................................................................
- Table 1 Test log..........................................................................................................................................................
I. INTRODUCTION
Scenario:
A math teacher wants to oversee the class' grades. To do that, he requests my
assistance in writing a brief application. He must input student IDs and grades,
then save the data in two different arrays (integer array for IDs and float array
for grades). Then, he must print out each student's ID and grade information.
He also needs to know who has the highest and lowest grade among the
students. My program should have the aforementioned features and be menu-
based. The application ought to return to the main menu once an option has
been completed so the user can select another one. There ought to be a way
to end the program.
II. IMPLEMENTATION
1. Structure of program
1.1 Library Declaration
Figure 1 Library Declaration
- #include <stdio.h>: To connect with any system-accepted file as well as with tangible objects like keyboards, printers, and terminals, this library uses "streams." Using streams is a more direct way to communicate with them. All streams have similar features, regardless of the particulars of the physical medium to which they are connected. The majority of the C file input/output routines are defined in this library.
- #include <stdlib.h>: There are several macros in this library, four sorts of variables, and a number of processes for carrying out general tasks. I use this library to pause the program, clear the screen, then end it. 1.2 Global Variable Figure 2 Global variable
I created a Main() function using printf() function to create options for the user to use. Then use the switch case statement to select the appropriate function to execute the program. Besides, I use while loop to repeat the user selection countless times until user chose to exit the program (case 7) with exit (0) code. Figure 5 Menu Option
1.5 Function definition Figure 6 Function Definition
2.4 Function “Diem Cao Nhat” The purpose of the function is to find the student with the highest score. First, by default, I attach the first student information to MaxGrade. Then I use a for loop from student 2 to student n-1 to check, if MaxGrade[i] < StudentGrade[i], then MaxGrade [i] = StudentGrade [i]. The end of the loop will find the student with the highest score, and I will print the result as MaxGrade. Figure 9 Diem Cao Nhat 2.5 Function “Diem Thap Nhat” The purpose of the function is to find the student with the lowest score. First, by default, I attach the first student information to MinGrade. Then I use a for loop from student 2 to student n-1 to check, if MinGrade[i] > StudentGrade[i], then MinGrade [i] = StudentGrade [i]. The end of the loop will find the student with the lowest score, and I will print the result as MinGrade.
Figure 10 Diem Thap Nhat
2.6 Function “ID Diem Cao Nhat”
The purpose of the function is to print the id of the student with the highest score. First, I will do as the function to find the highest score. Then I will use if statement to print out the id of the student with the highest score. Figure 11 ID Diem Cao Nhat
2.7 Function “ID Diem Thap Nhat”
The purpose of the function is to print the id of the student with the lowest score. First, I will do as the function to find the lowest score. Then I would use an if statement to print out the id of the student with the lowest score.
Figure 14 Min Grade 3.3 Find MaxID To find MaxID, we must first find MaxGrade. Then do one more for loop and if condition as shown in the picture. When the condition is true, the computer will pause the loop and print out the MaxID. Figure 15 MaxID 3.4 Find MinID To find MinID, we must first find MinGrade. Then do one more for loop and if condition as shown in the picture. When the condition is true, the computer will pause the loop and print out the MinID.
Figure 16 MinID III. PROGRAM RESULTS (P4) This is the program's menu, which has been created with an intuitive interface suited for all novice users. The relevant data input will be made by the user. The system will initially display all seven function possibilities to you; select one of them to initiate the function. Your job is to enter the appropriate request. Figure 17 Program Menu
When the user does option 5, the program will display on the screen the IDs of the students with the
highest scores.
Figure 22 Select Option 5
When the user executes option 6, the program will display on the screen the IDs of the students with the
lowest scores.
Figure 23 Select Option 6
When the user selects option 7, the program is closed. Enter any key to exit the program
Figure 24 Select Option 7
IV. TESTING
Test plan
Test case Test content Times Expected result 1 Enter the wrong number range of students (wrong data type). 1 Success 2 Enter the wrong number range of students (the student value > 30 students that I specified or <= 0 students). 1 Success 3 Enter wrong choices (choice <= 0 or choice > 7). 1 Success 4 Enter the wrong ID’s student (wrong data type). 1 Success 5 Enter the wrong score range of students (score value > 10 or < 0). 1 Success
6 Enter the wrong student's score (wrong data type). 1 Success
Test log
NO Name test Test content Expected result Real result Pass/Fail 1 Test Number of Student I enter the wrong data type to check how it works. The program displays a message asking the user to re- enter again. Fail 2 Test Number of Student I enter the wrong number range of student. The program will force me to enter again. Pass 3 Test Menu I will enter another choice from 1 to 7. The program will force me to enter again. Pass 4 Test ID Try to enter the wrong data it will let the user re-enter until the same data Fail
6 Test Grade Try entering the wrong data type of the point, what will it look like. It will start re- entering the score until it's the same data as it. Fail Table 1 Test log