Answered step by step
Verified Expert Solution
Link Copied!

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
1
of 2
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 -re-suing 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: NUM_OF_CAMPUSES
Member variables An integer that stores the total number of votes
An array of integers that has capacity of NUM_Of_CAMPUSES.
The campuses will be labeled by numbers (i.e., Santiago Canyon
College =1, Santa Ana College =2, and so on) where one
corresponds to index 0 of the array, 2 corresponds to index 1 of
the array, etc.
Default constructor Initializes the total number of votes to 0
Initializes all the array elements to 0.
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions