A
Micro Project Report On
"Online Polling System"
Subject: Java Programming (314317)
SUBMITTED BY
[Link] Kokate [74]
Under the Guidance of
Mr. [Link]
DEPARTMENT OF COMPUTER TECHNOLOGY
Sanjivani Rural Education Society’s
SANJIVANI K.B.P. POLYTECHNIC
KOPARGOAN – 423601, DIST. AHILYANAGAR
(2025-2026)
Sanjivani Rural Education Society’s
Sanjivani K.B.P. Polytechnic
DEPARTMENT OF COMPUTER TECHNOLOGY
Academic Year: 2025–26
CERTIFICATE
This is to certify that the Micro Project Report entitled
"Online Polling System"
Submitted by
Snehal Kokate [74 ]
Class : Second Year
Subject : Java Programming-314317
Under our supervision and guidance for partial fulfilment of the requirement for
Diploma in Computer Technology affiliated to Maharashtra State Board of
Technical Education, Mumbai.
2025-2026
Prof.Y.K. Dhotre Prof. S. A. Patil Prof. A.R. Mirikar
SUBJECT TEACHER HOD PRINCIPAL
Introduction
The Online Polling System is a simple console-based application
developed using Java. It allows users to vote for different options and view
the results.
The system provides a menu with three choices: vote, show results, and
exit. Users can select an option and their vote is recorded using arrays.
The program runs continuously using a loop until the user exits.
The application provides a menu-driven interface where users can choose
to vote, display the voting results, or exit the program. It uses arrays to
store the list of options and the number of votes received by each option.
The program runs continuously using a loop until the user decides to exit.
When a user selects the voting option, the system displays a list of choices
such as Option A, Option B, and Option C. The user can select any one
option, and the corresponding vote count is incremented. The system also
ensures basic validation by checking whether the entered choice is valid or
not.
When the user selects the “Show Results” option, the program displays the
number of votes received by each option along with the total number of
votes.
It uses basic programming concepts such as :
1. arrays
2. loops, conditional statements
3. Scanner class for user input.
Source Code
import [Link];
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner([Link]);
String[] options = {"Option A", "Option B", "Option C"};
int[] votes = {0, 0, 0};
int choice;
while (true)
{
[Link]("\n--- Online Polling System ---");
[Link]("1. Vote");
[Link]("2. Show Results");
[Link]("3. Exit");
[Link]("Enter your choice: ");
choice = [Link]();
if (choice == 1)
{
[Link]("\nChoose an option:");
for (int i = 0; i < [Link]; i++)
{
[Link]((i + 1) + ". " + options[i]);
}
[Link]("Enter your vote: ");
int vote = [Link]();
if (vote >= 1 && vote <= 3)
{
votes[vote - 1]++;
[Link]("Vote recorded successfully!");
}
else
{
[Link]("Invalid vote!");
}
}
else if (choice == 2)
{
[Link]("\n--- Results ---");
int total = 0;
for (int i = 0; i < [Link]; i++)
{
[Link](options[i] + ": " + votes[i]);
total += votes[i];
}
[Link]("Total Votes: " + total);
}
else if (choice == 3)
{
[Link]("Exiting...");
break;
}
else
{
[Link]("Invalid choice!");
}
}
[Link]();
}
}
Output
--- Online Polling System ---
1. Vote
2. Show Results
3. Exit
Enter your choice: 1
Choose an option:
1. Option A
2. Option B
3. Option C
Enter your vote: 2
Vote recorded successfully!
--- Online Polling System ---
1. Vote
2. Show Results
3. Exit
Enter your choice: 1
Choose an option:
1. Option A
2. Option B
3. Option C
Enter your vote: 1
Vote recorded successfully!
--- Online Polling System ---
1. Vote
2. Show Results
3. Exit
Enter your choice: 2
--- Results ---
Option A: 1
Option B: 1
Option C: 0
Total Votes: 2
--- Online Polling System ---
1. Vote
2. Show Results
3. Exit
Enter your choice: 3
Exiting...
Conclusion
The Online Polling System successfully allows users to cast votes and
view results using a simple menu-driven program. The code works
correctly by storing votes in arrays and updating them based on user
input.
The output shows that the program can handle multiple votes, display
accurate results, and calculate the total number of votes. It also checks
for invalid input, making it more reliable.
Overall, this project demonstrates the use of basic Java concepts like
loops, arrays, and conditional statements to build an interactive
application.
References:
1. Java switch Tutorial – [Link]
2. Java while loop Tutorial – [Link]
3. Java String Tutorial – [Link]
4. Array in Java Tutorial – [Link]
5. Java String Tutorial – [Link]
6. Java String Reference –
[Link]