Student Information Management Program: Functions and Algorithms, Assignments of Programming Languages

The structure and functions of a student information management program in C language. It includes the use of standard library functions, C functions, and algorithms to input, view, and find highest and lowest grades. The document also covers coding standards and examples of program results.

Typology: Assignments

2021/2022

Uploaded on 07/30/2022

trantuantd14
trantuantd14 🇻🇳

4.3

(4)

25 documents

1 / 26

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT 2 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
PROG102: Procedural Programming
Submission date
12nd of November 2021
Date Received 1st
submission
Re-submission Date
Date Received 2nd
submission
Student Name
Tran Anh Tuan
Student ID
GCD201675
Class
GED1001
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
Tuan
Grading grid
P4
P5
M3
M4
D2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Student Information Management Program: Functions and Algorithms and more Assignments Programming Languages 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 12 nd^ of November 2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Tran Anh Tuan Student ID GCD Class GED1001 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 Tuan Grading grid P 4 P 5 M3 M4 D

Summative Feedback:Resubmission Feedback: Grade: Assessor Signature: Date: Lecturer Signature:

  • CHAPTER 1. IMPLEMENTATION
      1. Problem.................................................................................................................................................................
      1. Solve problem
      1. Structure of program
      1. Function
      1. Function
      • 5.1. “Enter student information” function:
      • 5.2. “View student information” function:
      • 5.3. “View highest student grade” function:
      • 5.4. “View lowest student grade” function:
      • 5.5. “View menu” function:
      1. Algorithms
      1. Coding standards
  • CHAPTER 2. PROGRAM RESULT
      1. Result of the option
      1. Result of the option
      1. Result of the option
      1. Result of the option
      1. Result of the option
      1. Testing data case
      • 6.1. Test schedule
      • 6.2. Testing and result.........................................................................................................................................
      1. Analysis result
  • Figure 1. Standards library function Table of Figure
  • Figure 2. C functions
  • Figure 3. C functions
  • Figure 4. C functions
  • Figure 5. C Function
  • Figure 6. Variable
  • Figure 7.Executable part
  • Figure 8. “Enter student information” function
  • Figure 9. “View student information” function
  • Figure 10. “View highest student grade” function
  • Figure 11. “View lowest student grade”
  • Figure 12. “View menu” function
  • Figure 13. Switch case.................................................................................................................................................
  • Figure 14. CamelCase naming style in C
  • Figure 15. UPPER_CASE naming style in C
  • Figure 16. Bracket conversion
  • Figure 17. Result of menu function
  • Figure 18. Result of option
  • Figure 19. Result of option
  • Figure 20. Result of option
  • Figure 21. Result of option
  • Figure 22. Result of option

CHAPTER 1. IMPLEMENTATION

1. Problem

A math teacher wants to handle class scores. He asks for your assistance in preparing a small application. He must enter student IDs, student’s grades and store this information on two separate arrays (integer array for IDs and float array for grades). Next, he has to print all the student ID with their grade. Finally, he must know which student has the highest grade and the lowest grade. Your program would have to be menu based on the above options. When an option is completed, the program must return to the main menu so he can choose a different option. There ought to be an option to shut down the program.

2. Solve problem

I spell out 5 functions that are used to manage student information: ❖ Input student’s IDs, student’s grades ❖ Display student information ❖ Finding highest grade ❖ Finding lowest grade ❖ Exit

3. Structure of program

Library function: In the program, I will use 2 types of C standard library functions, which are: ➢ #include <stdio.h> : stands for Standard Input-Output. It contains information on input and output functions. ➢ #include <stdlib.h>: stands for Standard Library. It contains data on memory allocation and freeing functions. ➢ #define is a function that allows naming an integer or a constant real number. When compiling will replace the constants you are using with their key values. This replacement is called pre-compile.

Figure 3. C functions Figure 4. C functions

Figure 5. C Function

Figure 7 .Executable part

5. Function

5.1. “Enter student information” function:

  • Purpose: Used to perform the input of student information including grades and IDs.
  • Steps to take: ➢ To execute the program, we initialize the isValid variable whose task is to check the existence condition contained in the function. ➢ Since the range of user need to enter the number of all students to enter is in the range from 0 to 100 we need to use a while loop for the variable levels that will perform that action. The advantage of the while loop is that it checks the condition before it will repeat the code. ➢ We will use a for loop to iterate over the correct number of students to enter. Inside, is the do-while function to check the allowed exact range. ➢ In the ID input section, if the user enters a value of 0 and student[ID] is less than 0, the computer will return "invalid". ➢ In order to meet the criteria that the provided score is within the range

of 0 to 10, the user must input the student's score accurately. When a user submits an incorrect grade, the system returns "invalid" and returns to the previous re-entry of the grade. ➢ When all conditions are satisfied, the program will print the score and ID Figure 8. “Enter student information” function 5.2. “View student information” function:

  • Purpose: Used to view student grades and information.
  • Steps to take: ➢ In this feature, we use a for loop to help th program displa full student information. As well as using the printf() command to output the score and ID, we use %d and %f to perform printing in the command. Where %d is used to print integers and %d is used to print real numbers.

Figure 10. “View highest student grade” function 5.4. “View lowest student grade” function:

  • Purpose: Used to view the lowest grade in the list
  • Steps to take: ➢ Similar to finding the highest grade, we create the studentGrade array with 0 as an integer element. Then we create a loop to repeat the condition below. ➢ When min array is larger than studentGrade array, that means we reassign element i. After completing the assignment and comparison task, we will print the highest student and ID.

Figure 11. “View lowest student grade” 5.5. “View menu” function:

  • Purpose: Used to view the lowest grade in the list.
  • Steps to take: ➢ The printf statement in this function is used to print all the information the user needs in the article. We use the scanf command to receive input from the user into the program, finally fflush is used to clear the program's temporary memory so that there are no garbage values like above and we have can use cin.ignore() as another option.

condition and returns an error stating that the user entered it incorrectly. Figure 13. Switch case

7. Coding standards

Coding standards is a set of rules that regulate how to write the code of a program that programmers must follow when participating in a project to develop that program. There are different standards for each project. A set of rules has many types and the types we often encounter are the rules for naming variables, constants, functions, classes, ... or declare and use variables. Standards compliance helps us know what we're doing, and what's happening with lines of

code. It should be easy to find and correct mistakes. ➢ Naming conventions for etc: In the program, I use standard Camelcase writing. It is a naming convention for writing file or object names that contain at least one compound word or concatenation that begins with a capital letter. It is often used to name files and functions without violating the naming rules of the underlying language. It is useful in programming because element names cannot contain spaces. In the program, I also use PascalCase writing style for components in C, for example, menus,... Figure 14. CamelCase naming style in C As for the UPPER_CASE type, we often use them in the case of constants, which need to be used for many purposes in the code.

start, the system will show you all 5 function options and we will use one of these to start the function. Example: When you select option 2, you will get a list of all student IDs and grades. Figure 17. Result of menu function When the user selects option 1, a message prompting the user to input a few

students appears on the screen. Display user-selected options and statements for entering student information. Figure 18. Result of option 1