# Overview of the project

In this section we will build a polling app.

As a user, we will be able to:

  • Create polls.
  • View existing polls.
  • Vote on polls.
  • See how many votes each option in a poll has, both as a total and as a percentage of the total.
  • Select one of the poll options as "correct", and from voters of that option pick a random winner.

# The User Interface

Let's take a look at the user interface of this project.

Firstly, the menu they will see when they start up the application:

-- Menu --

1) Create new poll
2) List open polls
3) Vote on a poll
4) Show poll votes
5) Select a random winner from a poll option
6) Exit

Enter your choice:

# Creating new polls

...
Enter your choice: 1

Enter poll title: Which programming language are you learning?
Enter poll owner: jose

Enter new option text (or leave empty to stop adding options): JavaScript
Enter new option text (or leave empty to stop adding options): Python
Enter new option text (or leave empty to stop adding options): Swift
Enter new option text (or leave empty to stop adding options):

# Listing open polls

...
Enter your choice: 2

1: Which programming language are you learning? (created by jose)

# Voting on polls

...
Enter your choice: 3

Enter poll would you like to vote on: 1

1: JavaScript
2: Python
3: Swift

Enter option you'd like to vote for: 2
Enter the username you'd like to vote as: jose

# Showing poll votes

...
Enter your choice: 4

Enter poll you would like to see votes for: 1

JavaScript got 0 votes (0.00%)
Python got 1 votes (100.00%)
Swift got 0 votes (0.00%)

# Selecting random winner

...
Enter your choice: 5

Enter poll you'd like to pick a winner for: 1
Enter which is the winning option, we'll pick a random winner from voters: 2
The randomly selected winner is jose.

# Wrapping Up

Because we're running this app in our own computer, it's not terribly useful.

However, if you could allow people to vote over the internet, you can see how this could become extremely useful.

We've got some videos on our YouTube channel covering how to do that: