CS371p: Object-Oriented Programming

Spring 2018: 51620

Project #2: Voting
Due: Thu, 15 Feb 2018, 10pm
85 pts, 8.5% of total grade.


Write a program, ideally with a partner, to solve Voting [C++14 (g++ 7.1.0, C++14 standard, 2 sec, 512 MB)] with an optimization that when reassigning the ballots of a loser, you do not iterate over all the ballots.

You may not use new, delete, malloc() or free(). You may use the STL.


These are additional descriptions of the underlying math:


See Workflow.

Below, GitHubID is always that of the owner of the repo.


These are the URLs involved:


HackerRank Contest: https://www.hackerrank.com/cs371p-spring-2018-voting/

Points Assets Notes
40 pts
  • 3 tests
percentage of tests passed

GitHub private classroom repo: https://github.com/cs371pc-spring-2018/voting-GitHubID/

Points Assets Notes
5 pts
  • GitHub issue tracker
Quality of the issues.
  • at least 15 closed issues
10 pts
  • Voting.h
  • Voting.c++
Quality of the code.
  • assertions
  • clang-check results
  • clang-format output
  • an optimization that when reassigning the ballots of a loser,
    you do not iterate over all the ballots
5 pts
  • RunVoting.c++
  • RunVoting.in
  • RunVoting.out
Quality of the acceptance tests.
  • at least 500 lines
5 pts
  • TestVoting.c++
Quality of the unit tests.
  • at least 15 tests
  • run gcov
  • run valgrind
5 pts
  • html/
  • Voting.log
Quality of the documentation.
  • doxygen (Voting.h only) output
  • Create inline comments if you need to explain the why of a particular implementation.
  • git log
5 pts
  • .gitignore
  • .travis.yml
  • makefile
  • README (optional)
Quality of the private code repo.
  • at least 5 commits with meaningful commit messages

GitHub public test repo: https://github.com/cs371pt-spring-2018/voting-tests/

Points Assets Notes
5 pts
  • GitHubID-RunVoting.in
  • GitHubID-RunVoting.out
Quality of the public test repo.

Travis CI Log: https://travis-ci.com/cs371pc-spring-2018/voting-GitHubID/

Points Assets Notes
5 pts
  • Travis CI log
Quality of the integration.


  • You can earn 5 bonus pts, if you work with a partner using pair programming and vouch for the fact that you worked on the project together for more than 75% of the time.