You are on page 1of 21

Introduction of C programming.

INDIVIDUAL ASSIGNMENT

TECHNOLOGY PARK MALAYSIA

CT018-3-1-ICP

INTRODUCTION TO C PROGRAMMING

INTAKE CODE

NPT1F2309

HAND OUT DATE: 05 JANUARY 2024

HAND IN DATE: 05 MARCH 2024

WEIGHTAGE: 50%

P a g e 1 | 21
Introduction of C programming.

Contents
1.0Introduction......................................................................................................................................................3
2.0Assumption......................................................................................................................................................3
3.0Design of program............................................................................................................................................4
3.1Pseudocode...................................................................................................................................................4
3.2flowchart....................................................................................................................................................11
4.0program output...............................................................................................................................................12
4.1View home page.........................................................................................................................................12
4.2View schedule output.................................................................................................................................12
4.3 Add Constituency Output..........................................................................................................................13
4.4View candidate output................................................................................................................................14
4.5candidate registration.................................................................................................................................15
4.6Delete candidate output:.............................................................................................................................15
4.7Update candidate output.............................................................................................................................16
4.8View voters details:....................................................................................................................................16
4.9Register voters details:...............................................................................................................................17
4.9.1Update voter’s details..............................................................................................................................18
4.9.2Search voter details.................................................................................................................................19
7.9.3Castvote...................................................................................................................................................19
5.0Conclusion.....................................................................................................................................................20
6.0Reference.......................................................................................................................................................21

P a g e 2 | 21
Introduction of C programming.

1.0Introduction

During the development of this voting system, I have used the C programming language and the dev~c++
application. This system is based on the democratic process, which ensures transparency, fairness, and
favorability. This system consists of very important parts, which are scheduling election times, maintaining
candidates, and registering people for voting. I am the administrator of this system, so I fixed the time of the
election, which will be stored in schedule.txt. admin can register a candidate, which can be modified by adding
another candidate or removing a candidate. After registering, the candidate details will be stored in
candidate.txt. To register as a voter, their age should be 18+. If they are eligible, they can register as a voter, and
voter details will be registered in voter.txt, which can be modified after registering, and voters names can be
searched by voter number. On election day, voters vote their ballots by using their identification. They vote for
their candidate by choosing a candidate from their district. After voting, it will be stored in votecount.txt. In the
development process, I have been following programming principles like variable name rules and maintaining
correct formatting. The system is modular and menu-driven for use and doesn’t have a graphical user interface.

2.0Assumption
I have made various assumptions to building this system. The administration is allowed to make decision about
election schedule along constituency then information will be store in schedule.txt file. Candidate registration
will be done by the administration and will store in candidate.txt. To vote age should be greater than 18
otherwise you are not eligible for voting. Voter data can be manipulated as per requirement also we can search
for voter by their voter number which are stored in voterlist.txt . voter enter the system to cast their vote by
authentication which will be stored in votecount.txt . At last the system will show election result which are
store votecount.txt.

P a g e 3 | 21
Introduction of C programming.

3.0Design of program
3.1Pseudocode
Pseudocode is a human-readable representation of a computer program or algorithm. It is a detailed plan of the
program's actions, explained in straightforward language and basic ideas. Although not executable by a
computer, this tool assists programmers in structuring and arranging their code prior to implementing it in a
particular programming language. (Sheldon, n.d.)

P a g e 4 | 21
Introduction of C programming.

P a g e 5 | 21
Introduction of C programming.

P a g e 6 | 21
Introduction of C programming.

P a g e 7 | 21
Introduction of C programming.

P a g e 8 | 21
Introduction of C programming.

P a g e 9 | 21
Introduction of C programming.

P a g e 10 | 21
Introduction of C programming.

3.2flowchart

A flowchart is a visual representation that illustrates the functionality of a computer program or process. The
application utilizes symbols such as arrows and shapes to represent the stages and decisions involved.
Programmers use flowcharts to strategize the functionality of their software before commencing the actual
coding process. It aids individuals in comprehending the rationale and organization of their plan. (An
introduction to Flowcharts, n.d.)
P a g e 11 | 21
Introduction of C programming.

4.0program output.
4.1View home page

After execution of the code, we can the homepage of the system or main menu. Here we can see three options.
The first option is about the election schedule, the second is about the candidate task third is the vote which
involves various operations which I will discuss below. If user inputs invalid option it will display wrong
choice.

4.2View schedule output

After choosing 1 in the main menu users get to choose again. To know about the election. Users need to select 1
to view the election schedule of different districts or constituencies.

P a g e 12 | 21
Introduction of C programming.

4.3 Add Constituency Output.


To add the election schedule user needs to enter a password and username for authentication if the user is an
admin or not if the user inputs the wrong password and username system will print you are not an admin. if user
is admin and provide correct password it allows to schedule election.

P a g e 13 | 21
Introduction of C programming.

4.4View candidate output

Every voter should know who the candidate of their place are So, they can view who is running for the election
and choose before casting the vote.

P a g e 14 | 21
Introduction of C programming.

4.5candidate registration

To register a candidate user needs to authenticate as admin first and then system ask for name of candidate,
political party symbol and place where he/she is giving candidacy. After this the system will display the
message of successful registration.

4.6Delete candidate output:

There can be various cases where candidates want to withdraw their name from the election during that
situation admin can delete candidate name simply by entering name of candidate.

P a g e 15 | 21
Introduction of C programming.

4.7Update candidate output

To update the candidate user need to be admin and enter password after that system will ask for the candidate
name, party symbol and new candidacy which will store in candidate.txt file.

4.8View voters details:

Admin is only allowed to see voter details which are store in voterlist.txt. voters details contains of full name,
Sno number, date of birth, address and password of voter requires for casting vote. SNO is unique number
generated by the system for every voter.

P a g e 16 | 21
Introduction of C programming.

4.9Register voters details:

During every
election we need
to add or register
voters, so it is a
very mandatory
feature required
in voting system.

In this system admin only allowed to register voters. Voters need to


provide their name, date of birth to check he/she is eligible to vote or not if
age is below 18 they are not allowed to vote and address after this
information will be store in voterlist.txt file.

P a g e 17 | 21
Introduction of C programming.

4.9.1Update voter’s details

To update voter details you need to be admin. For updating voter details you need to enter id or SNO of voter
and password of voter if that is correct then system will ask for new name, DOB, new address and new
password of voter after inputting details system will display message of successful but if id and password didn’t
match it will print message saying password not matched.

P a g e 18 | 21
Introduction of C programming.

4.9.2Search voter details

Simply by entering id of voter we can see details of voter which are store in voter.txt file. It will show id, name,
DOB, address and password of voter.

7.9.3Castvote

To cast vote user need to provide their voter Id first then password, age and party symbol after entering all this
details system will store it in votecount.txt file. After the end of election we can see total vote received by the
candidate by using feature voting result which reads all the vote which are store in votecount.txt.

P a g e 19 | 21
Introduction of C programming.

5.0Conclusion

The system reflects democratic principles. The administrators of this system can schedule the election, and
candidates can be registered by the administrators by taking their data, such as name, political party, and
district. If the candidates are eligible, then only they will be registered in the cadidatelist.txt. Voters can be
added to the system by providing details such as DOB, name, and address, and voters need to enter their
passwords to determine if they are eligible. After this, voters are also allowed to update their details if any kind
of mistake in the data is found. Admins can search for details too. Voters can cast their vote by using their SN
number and entering a password. After the casting of votes is done, we can see the vote count result. So
whoever has received the maximum number of votes will be elected.

Overall, my project demonstrates that I am able to write code properly, and this system is fair.

P a g e 20 | 21
Introduction of C programming.

6.0Reference
An introduction to Flowcharts. (n.d.). Retrieved from GeeksforGeeks: https://www.geeksforgeeks.org/an-
introduction-to-flowcharts/

Sheldon, R. (n.d.). pseudocode. Retrieved from TechTarget:


https://www.techtarget.com/whatis/definition/pseudocode

P a g e 21 | 21

You might also like