Help Code Errors Please C Candidatetypecpp Include Include Include Include Candidatetypeh Q37261086

.Help me with my code errors please c++

CandidateType.cpp

#include
#include
#include
#include “candidateType.h”

using namespace std;

void candidateType::setVotes(int region, int votes)
{
   votesByRegion[region – 1] = votes;
}

void candidateType::updateVotesByRegion(int region, intvotes)
{
   votesByRegion[region – 1] = votesByRegion[region – 1]+ votes;
}

void candidateType::calculateTotalVotes()
{
   totalVotes = 0;

   for (int i = 0; i < NO_OF_REGIONS; i++)
       totalVotes +=votesByRegion[i];
}

int candidateType::getTotalVotes() const
{
   return totalVotes;
}

void candidateType::printData() const
{
   cout << left
       << setw(10) <<firstName << ” “
       << setw(10) << lastName<< ” “;

   cout << right;

   for (int i = 0; i < NO_OF_REGIONS; i++)
       cout << setw(7) <<votesByRegion[i] << ” “;
   cout << setw(7) << totalVotes <<endl;
}

candidateType::candidateType()
{
   for (int i =

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.