Download Student Information Management System and more Study notes Marketing 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 Vang Phu Qui Student ID GCH
Class GCH1106^ Assessor name Dinh^ Duc Manh
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 Qui
Grading grid
P 4 P 5 M3 M4 D
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date:
Lecturer Signature:
1.Implementation
1 .1.Structure of program
My program including:
Declaring libraries used in program
- <stdio.h>: Provide the core of the typing capabilities in C.
- <string.h>: To adjust a variety of character rangers.
Picture 1: Declaring libraries.
Declaring variables used in program
- Int: This is an integer, it basically represents the natural size of integers, used to set
variables in the program.
Picture 2: Int.
- Float: This is a real number type, used to hold floating point numbers. For example 3.
and 9.8 are real numbers. It’s used to declare the variable Grade in the program.
Picture 3: Float.
- Void: This is a data type, so it also represents the size of the information and the type of
information of the object that uses it. Void is a data type representing a state where the
data type does not exist. In the program, it’s used to store the display data.
Picture 4: Void.
- Strcmp : The strcmp() compares two strings character by character. If the strings are
equal, the function returns 0.
- Printf: The printf() command is included in the C <stdio.h> library, which helps to
display the message on the output screen.
Picture 5: Printf.
- Return 0: This statement terminates the C program and returns null, that is 0. If void()
function is used, there is no need to write the return 0.
Picture 6: Return 0.
2.Function and how each function is used in program.
2.1.View Menu in program
Picture 7: Menu in the program.
Explain:
- Here uses int function to display an optional type. Each printf statement corresponds to
a selection from the switch case and after each case is a break statement to not execute
the following cases.
2.4.Display student’s ID with the highest grade.
Picture 10: Display student’s ID with the highest grade.
Explain:
- Void max() has the function of displaying the IDs of the students with the highest grades for teachers to see and know. Use an if statement to compare grades between students and for loops and finally a print statement to show the teacher.
2.5 Display student’s ID with the lowest grade.
Picture 11: Display student’s ID with the lowest grade.
Explain:
- Void min() has the function of displaying the IDs of the students with the lowest grades for teachers to see and know. Use an if statement to compare grades between students and for loops and finally a print statement to show the teacher.
2.6.Finding student’s by code
Picture 12: Finding student’s by code.
Explain:
- Void search() has the function of finding the IDs of the students for teachers to see and know. Use an if statement to compare id between students and for loops and finally a print statement to show the teacher.
2.7.User Login
Picture 13: User Login.
Explain:
- Void userLogin() has the function of log in the program. Sse while loop, print username and password. use strcmp to check the username and password, if it is correct, you will enter the program, if it is wrong, you will have to re-enter it until it is correct.
3.3 Print all student’s information.
Picture 16: Print all student’s information.
3.4 Display student’s ID with the highest grade.
Picture 17: Display student’s ID with the highest grade.
3.5 Display student’s ID with the lowest grade.
Picture 18: Display student’s ID with the lowest grade.
4. Testing
NAME OF TEST & CONTENT
DAY TEST &
ESTIMATED
EFFORTS
DESIRED RESULT ACTUAL RESULTS ANALYZE NEEDED
1 Wrong user name and password
29/10/2022 Print a message asking to re- enter the selection.
Correct the result
Test completed
2 Wrong grade
29/10/2022 Create a loop of input points until correct
Correct the result
Test completed
3 Test view ID and Grade of student has highest grade.
29/10/2022 Display correct result including ID and grade of student has highest grade
Correct the result
Test completed
4 Test view ID and Grade of student has lowest grade.
29/10/2022 Display correct result including ID and grade of student has lowest grade
Correct the result
Test completed
5 Test view ID and grade
29/10/2022 Display correct result including ID and grade of students
Correct the result
Test completed