# need help with a small voting program / c++



## momo12 (May 22, 2003)

Hello,

Was wondering if anybody had any sample code for a simple voting program?

Bascially when the program runs - > asks if user would like to vote or not
- > If Yes
- > option 1
- > option 2
- > option 3
- > option 4
- > then show amount of people have voted for options
- > if no - > loop back to the start 

A very simple sample is all I need as I'm new to c++ any help is appreciated! 

Thanks!


----------



## Shadow2531 (Apr 30, 2001)

Attached is an example that should get you started. Tweak it to your liking. (rename it with a .cpp extension or select the text and copy)

Made with Bloodshed Software's Dev-C++ Version 4.9.8.0

http://www.bloodshed.net


----------



## AlbertB (Nov 24, 2002)

Try using this as the basis for your voting system.

I would suggest getting your machine to create a New Console Application and select "Hello World" type. Then post this code into the main .cpp.

It is more complicated than Shadow's compact version. His is better to get you started. I have just tried to take a few jumps further on with a few separate functions and suchlike. Even if you just read the code you should see where it is going, and each function can be analysed separately.

Good luck.


----------



## momo12 (May 22, 2003)

thanks guys for both


----------

