















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Almost got Distention and didn't give any more explanation
Typology: Assignments
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















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 DNG^ Student ID Class Assessor name 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 P 4 P 5 M3 M4 D
Grade: Assessor Signature: Date: Lecturer Signature:
After I have designed the solution for the Assignment 1 situation. In Assignment 2, I will demonstrate how to apply procedural programming in solving the scenario. I will use C language to create the best possible software that I have learned after taking Procedural Programming. Actually, when I did assignment 1, I wrote a program that met the requirements, but it was not very good when I could not separate the code in the main () function into functions. However, in this Assignment 2 I have overcome that. In addition, I have made an extra step so that users have to log in to use the program and I also created a few functions that are quite useful in managing students' grades. In this assignment, I will present in 2-chapter as: Chapter 1: Implementation and explain program Chapter 2: Test Plan
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. The following is a program that I created to respond to this situation and it also has a few more interesting features. I'll break it down into important pieces of code so that it's easier for people to understand my program.
When going to each function, I will explain more about how variables are used in the operation of the program.
2.3.1 Function login Figure 3 - Function login A new function compared to my assignment 1. This is a feature I find very interesting and I have invested a lot of time in reading documentation and writing code. This function has the ability to require the user to enter the correct "loginname (admin)" and "password (123456)", then the program will start showing the
main interface for users to use the program. This function is written based on the endless loop āWhileā to ask the user for correct input and the function āstrcmp(string compare) ā information, the program will print the message "Login success". Figure 4 - Running Function Login 2.3.2 Function input
"input" function will stop. Figure 6 - Running Function Input 2.3.3 Function output
Figure 7 - Function Output Figure 8 - Running Function Output
2.3.5 Function average Figure 11 - Function Average Figure 12 - Running Function Average 2.3.6 Function passrate Figure 13 - Function Passrate
Figure 14 - Running Function Passrate 2.3.7 Function max Figure 15 - Function Max Figure 16 - Running Function Max 2.3.8 Function min
Figure 19 - Set color for program and input total student Figure 20 - Running Input Total Student
Figure 21 - Menu Control
Figure 24 - Error when user did not enter student information before
be notified that: āData has been enteredā and the break statement will stop the case. first. Figure 25 - When user choose case 1 twice in a row