Anyone know how to write code that will allow someone to like vote betweeen two options and then calculate the total for each at the end, but skipping some values?
I was thinking of using continue statements to erase lines.
i am trying to make you choose between 2 candidates either 1 or 2. if you want1 you type 1 and if you want 2 you click 2. then in the end it totals up the number of times 1 and 2 were clicked, displaying the winner. in the final total some votes are left out of the count.
Like if you type 1 15 times and 2 20 times, it would only show up as 10 1s and 15 2s.
Getting input from the user and counting up results is about as basic as C++ can possibly get. I would forget about the "skipping some values" part for now and just write it so it keeps track of the two numbers accurately. What is the point of taking a vote and then not reporting the correct results anyway? Why not just ignore the input and return a random number? Is there supposed to be some pattern to the skipping?
In any case, if you post the code you've started you will get some help but no one is going to write it for you. ;-)