Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Page 1 of 2 Final Project Part B A CandidateType defines a candidate that runs for the presidential election of the student government. There are
Page
of
Final Project Part B
A CandidateType defines a candidate that runs for the presidential election of the student government.
There are four community college campuses participating the election process. Each campus manages
its own voting process.
You will need to implement the CandidateType class that inherits from the PersonType class.
Since the CandiateType inherits from the PersonType class, MAKE SURE you implement your code
efficiently by resuing the functions that are already available in the PersonType.
CandiateType class
Global constant Declare a global constant integer, right before the class
definition, to store the number of participating campuses.
Name your constant: NUMOFCAMPUSES
Member variables An integer that stores the total number of votes
An array of integers that has capacity of NUMOfCAMPUSES.
The campuses will be labeled by numbers ie Santiago Canyon
College Santa Ana College and so on where one
corresponds to index of the array, corresponds to index of
the array, etc.
Default constructor Initializes the total number of votes to
Initializes all the array elements to
Function updateVotesByCampus Parameters: The Campus number and the number of votes for
that campus.
Updates the total number of votes and the number of votes for
the campus specified
Function: getTotalVotes Return the total number of votes
Function: getVotesByCampus Parameter: The Campus number.
Returns the votes for the specified Campus.
Function: printCandidateInfo Prints information about the candidate in the following format:
######### lName, fName
Note: the # should be replaced with integers.
Function:
printCandidateTotalVotes
Prints the candidates total votes in the following format:
Lastname, Firstname
Total Votes all campuses : ##
Note that # should be replaced with an integer.
Function
printCandidateCampusVotes
Parameters: The Campus number.
Prints the candidates vote for the specified Campus:
Lastname, Firstname
Campus # total votes: ##
Note that # should be replaced with an integer.
Destructor empty
Make Sure you consider when to:
Pass by reference
Use a const modifier for your parameter
Use a const modifier for your function
Create a Main.cpp file to test your functions.
Start writing every class you write in Unified Modeling Language UML Please do your own research if
you need information on topics not covered in class.
By you end of Part B of the project, you must have part A Part B completed including UML for all the
classes used.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started