Secp 1013 Programming Technique
Secp 1013 Programming Technique
SECTION : 02
SEMESTER : 20232024/2
PREPARED BY : GROUP 5
1. Introduction 3
2. Task Distribution In A Team 4
3. Design Flowchart 5
4. Code/Program 6-11
4.1. Input
4.2. Output
5. Input Data File 12-13
6. Output On Screen & Output File 14-15
7. Video Project Link 16
8. Closing/Summary 16-18
1.0 INTRODUCTION
Assalamualaikum w.b.t. and warm greetings to our esteemed lecturer, Dr. Cik Suhaimi Bin
Yusof.We would like to express our deepest gratitude for your unwavering support and guidance
throughout our SECP 1013 Programming Technique course. Your dedication and expertise have
been invaluable in helping us complete this project.We also extend our sincere appreciation to our
Group 5 members: Kirtigen a/l Vijayakumar, Alif Haikal, and Rayen Reymond, for their
cooperation, innovative ideas, and tireless efforts. Working together as a team has been an
incredible experience, and we are thrilled to have shared this journey.Our project aimed to apply
the programming techniques we've learned in this course to solve a real-world problem. We began
by carefully understanding the problem statements, then designed solutions using flowcharts and
C programming. We translated our logical designs into executable C programs, utilizing various
programming constructs such as arithmetic expressions and arrays.Throughout this project, we
encountered several challenges that tested our problem-solving skills. However, these challenges
helped us develop a deeper understanding of the subject matter. We gained substantial practical
experience, particularly in debugging and optimizing code.
We hope that the solutions and coding presented in this project will serve as a valuable resource
for others studying this course. Our experiences and the knowledge we've gained can provide
guidance and inspiration for fellow students embarking on similar projects.In conclusion, we are
grateful for the opportunity to apply our learning in a practical context. We look forward to
continuing our journey in the field of programming with renewed confidence and enthusiasm.
2.0 TASK DISTRIBUTION IN A TEAM
2. Introduction Kirtigen
6. Code/Program Rayen
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_STUDENTS 20
#define MAX_QUESTIONS 20
typedef struct {
char id[10];
char name[20];
int missed;
float percentage;
char grade;
} Student;
// Function prototypes
Student students[MAX_STUDENTS];
int numStudents = 0;
readFile(students, &numStudents);
readCorrectAnswers(correctAnswers);
return 0;
if (fp == NULL) {
exit(1);
}
while (fscanf(fp, "%s %s", students[*numStudents].name, students[*numStudents].id) != EOF) {
students[*numStudents].answers[MAX_QUESTIONS] = '\0';
students[*numStudents].missed = 0;
students[*numStudents].percentage = 0.0;
(*numStudents)++;
fclose(fp);
if (fp == NULL) {
exit(1);
fclose(fp);
}
// Function to compare student answers with correct answers
if (students[i].answers[j] != correctAnswers[j]) {
students[i].missed++;
students[i].grade = 'A';
students[i].grade = 'B';
students[i].grade = 'C';
} else {
students[i].grade = 'F';
printf("EXAM RESULT\n");
if (student.answers[i] != correctAnswers[i]) {
char id[10];
scanf("%s", id);
if (fp == NULL) {
exit(1);
fprintf(fp, "Name\tID\tPercentage\tGrade\n");
if (strcmp(students[i].id, id) == 0) {
printMissedQuestions(students[i], correctAnswers);
fclose(fp);
}
5.0 INPUT DATA FILE
StudentsAnswer.dat
Abdullah A19EE0180 A B C F B A B A A C A C B A B C A C A A
LuDong A19EE0160 A B D D A C B D D B C A A D C D A B C D
Syarifah AC12CS678 A A D C B C D D A B C C A A C D A D C D
Sivarajah AC12CS123 C B C B A C C D B B C C A B C D C C C D
Wendy B19EE0167 A C C D A B C C A A C D A A A D A B C D
Raj A19EE0170 B C A C B B B A C B A C B C A B A C B A
Liew A19EE1234 C B C C B A B C A A B B A B C B B C A A
Chong B19EE1234 C A B B C A C C B A B B B A A A C A A A
Azad B19EE4321 C B C A A A B A C B A A B C A C B A A A
Tan AC12CS312 C B C A A A C B C A B B A C B C B A C A
Isaac AC12CS324 C A A B A A B C B A C A B C B A B C A A
Chau A19EE4321 A B C B B A B A A C A C B A B C A C A A
Kumar A19EE1234 A B C D A B C D A B C D A B C D A B C D
Alip A19EE2143 C B A A C A A C B B B A A A A A A A A A
Lee AC12CS223 C B C B B A B A A C A C B A B C A C C C
Ismail B19EE2211 B A C A B A C A B C A A A C C B A A B A
John B19EE1212 A A C C A B B C A A C B B C A B A A C A
Aszue AC12CS456 B B A B A C A A C A B B C B C A C A A A
Jason AC12CS678 A B C A B A A A A C A C A A B C A C A A
Joven A19EE2707 B D A D D C B A A B C A B A C A C B A A
CorrectAnswers.txt
ABCDABCDABCDABCDABCD
6.0 OUTPUT (ON SCREEN & OUTPUT FILE)
Output on screen
Output file
7.0 VIDEO PROJECT LINK
https://drive.google.com/file/d/1cB0ixi72jqkpgNo4UayOdM2Jjd3iyExU/view?usp
=drivesdk
8.0 SUMMARY
From this project, we have learned the application and the techniques in the C Programming the
knowledge that we had in the class. Starting from understanding the question, flowchart, arranging
what might be in the coding, a lot of challenges and learning and also developed our problem solving
skills and new things on how to implement the file into the code. Through this project, we learned
the importance of teamwork and collaboration, as well as the value of clear communication and
documentation. We are confident that these skills will serve us well in our future programming
endeavors.We have some function prototypes that we wanted to highlight from this project which are ;
This project has been an enriching and educational experience that has allowed us to deepen our
understanding of C programming and its practical applications. We have learned how to define and
implement multiple functions, each with a specific purpose, and how to use function parameters to
pass data between functions. This approach has helped us avoid the use of global variables and
ensured that all data is passed explicitly.Throughout the project, we gained valuable experience in
reading input data from text files and storing this data in arrays for further processing. We also learned
how to compare students' answers with the correct answers, determine the number of questions
missed, and calculate the percentage of correctly answered questions. This information was then used
to determine a grade for each student.In addition, we learned how to format and display results on the
screen, including detailed information about missed questions and overall performance. We also
gained experience in writing output data to a text file, creating a comprehensive report of all students'
performances.
Overall, this project has significantly enhanced our understanding of C programming, especially in
areas such as file I/O, array manipulation, function implementation with parameter passing, and
generating formatted output. We have gained practical experience in designing, implementing, and
testing a complete C program, which will be invaluable in our future programming endeavors.
As we move forward, we are excited to continue building upon the skills and knowledge we have
gained through this project. We are confident that our renewed understanding of C programming will
serve us well in our future academic and professional pursuits. We look forward to continuing to learn
and grow as programmers, and to applying our skills to solve real-world problems.