











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
ProG102 C language. I'll just do the Pass part
Typology: Assignments
1 / 19
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 10 /09/ 2021 Date Received 1st submission Re-submission Date 18 /09/ 2021 Date Received 2nd submission Student Name Huynh Bao Trong Student ID GCC Class GCC0902 Assessor name Nguyen Hung Dung 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:
Assignment Brief Scenario: Please refer to scenario in Assignment 1. Tasks 1 Your next task is to implement the software that you designed in previous steps. You need to implement the software designed in assignment 1 using C programming language. Your code must make use of programming standards, including file headers and effective code commenting. You need to provide screenshots of your program when running. During the development of your program, if you make any changes to the original design, state them with reasons in report. Your code listings must be included as an appendix. Task 2 Test your program by making a test plan, execute it and log results. Your test plan should include data validation and program operations based on requirements. Test results (passed or failed) should be analysed to help the program in future maintenance. Task 3 Write an evaluation and conclusion of the whole development. The evaluation of your program should be based on its running and its test result. You should mention about lessons learnt and future improvement. Also evaluate how procedural programming is applied in your program, state benefits, disadvantages or difficulties. A final report of these 3 tasks must be submitted in PDF format to CMS. Submission Format The submission is in the form of a Word document. You are required to make use of appropriate structure, including headings, paragraphs, subsections and illustrations as appropriate, and all work must be supported with research and referenced using the Harvard referencing system.
Test Plan:
user selects "Maximum grade of student".
#include<stdio.h> #include<conio.h> //Function of variable int Variable(char c[]) { int i,a; for(i=0; i<strlen(c) ;i++) { if(c[i] >= '0' && c[i] <= '9') { a =1; } else { a =0; break ; } } if(a ==1) return 1; else return 0; } //Function Input information of students void InputStudent(int ID[], float Grade[], int n) { int i=0; int j; do { printf("Enter student ID %d:",i+1); scanf("%d",&ID[i]); for (j=0;j<i;j++) {while(ID[i]==ID[j]) { printf("Duplicate ID , please enter again\n"); printf("Enter student ID %d:",i+1); scanf("%d",&ID[i]); }
do { printf("Enter student Grade %d:",i+1); scanf("%f",&Grade[i]); if(Grade[i]<0 || Grade[i]>10) printf("Please Input again\n"); } while(Grade[i]<0 || Grade[i]>10); i++; }while (i<n); } //Function Output information of students void OutputStudent(int ID[], float Grade[], int n) { int i; printf("\nStudent Information:"); for (i=0; i<n;i++) { printf("\nStudent ID %d: %d",i+1, ID[i]); printf("\nStudent Grade %d: %.2f ",i+1, Grade[i]); } } //Function find the maximum grade of student float FindMax(float Grade[], int n) { float max; int i; max =Grade[0]; for (i=0;i<n;i++) if (max < Grade[i]) max = Grade[i]; return max; } //Function find the minimum grade student float FindMin(float Grade[], int n) {
if(choice ==1) { OutputStudent(ID, Grade, n); } else if(choice==2) { printf("\n Maximum grade of student %.2f",FindMax(Grade,n)); } else if (choice==3) { printf("\n Minimum grade of student %.2f",FindMin(Grade,n)); } else if(choice==4) { exit(1); } else { printf("Invalid choice"); } }while (choice != 4); }