This assignment is to be implemented using object oriented programming. It involves implementing a simulation of an election campaign and the election itself.
In addition to providing code you need to do the following:
- Submit a draft UML like class diagram indicating how your classes are structured and related.
- Submit a final report, which contains a final UML like class diagram reflecting the structure in your code, and text/tables/diagrams addressing the points below:
- Describe qualitatively, so not numerically, the five (5) different issues that you have chosen.
- Describe the three (3) political parties and specify the range of stances on each of the issues.
- Describe the characteristics of your electorates, and how the stance distribution for the electorates is modelled.
- The winner for an electorate is the candidate for that electorate who obtains the most votes.You need to describe how the number of votes for each candidate is obtained. There should be randomness in this process. While the process doesnt need to be particularly complicated, there should be dependence on the relative stances of electorates and candidates, and on candidate popularity.
- Describe the characteristics of the candidates and the qualitative impact they have.
- Describe the characteristics of the other people associated with the political parties and thequalitative impact they have.
- Describe what local and national events you have chosen, and how the event mechanisms qualitatively depend on the characteristics of the components described above.
General notes
These are some general rules about what you should and shouldnt do.
- Your assignment should be sensibly organised with the same kind of expectations in this area asassignment one, although you may reasonably have more files for this assignment. No memory leaks etc. too.
- Other than the initial command line input, the program should run without user input. In particular this means there shouldnt be pauses waiting for the user to press a key.
- There shouldnt be pauses generally, please dont use sleep!
- Your code must compile on capa with the compilation instructions you provide in txt. If it doesnt you will likely receive zero for the coding part of the assignment.
- You have to use classes, and should make use of encapsulation.
- You must use inheritance. If you dont use inheritance you will lose a fair few marks.
- You can use polymorphism, if its appropriate.
- If you use operator overloading, it should be appropriate.
- You can use your own data files to import for names or similar information.
- Output should only be to standard out or standard error.
1 A political episode
The nation is on edge ahead of the impending election campaign. The leaders have presented their candidates and published manifestos detailing their plans for the nation. You need to design and build a simulation of the campaign and subsequent election.
Your code should compile on capa according to instructions you provide in a Readme.txt file. Once your program is compiled into the executable APE, it must run as follows:
./APE n m
where n is the number of electorates in the nation, and m is the number of campaigning days prior to the election. The value of n should be in the range 1 to 10 inclusive. The value of m should be in the range 1 to 30 inclusive.
On running, APE should report on each party, so their stance values and the relevant details of their candidates, leader, and other significant figures.
APE should also report on the state of the nation, so give details on the electorates including the stance distribution.
2 Components
You need to give consistent and appropriate definitions for a class hierarchy associated with the various components of the campaign and election.
2.1 Issues
You need to decide on five (5) issues of relevance, so concerns, for the nation. These can be realworld national issues, such as global warming, realworld local issues, such as road infrastructure, or notso likely issues, such as the distribution of cat food. For the purpose of simplicity we model a stance on an issue as being twodimensional, with the dimensions being:
- The significance of the issue.
- The approach taken to the issue. You dont need to specify what the approach means, its just ascale where similar values mean similar approaches and quite different values mean quite different approaches.
Each party, candidate, and electorate will have different stances on each. Stance values may be changed by events.
2.2 Political parties and candidates
Each political party has the following officials:
- One leader, not themselves a candidate for an electorate.
- One candidate for each electorate.
- One campaign manager for each electorate.
- One national campaign manager.
- One national financial manager.
Each political party has a range across each stance. You define this for each of your three political parties. Initial stance values should be randomly generated as somewhere in that range, both for the party, party candidates, and the party leader.
Both the leader and the candidates will have popularity, and at least one other characteristic. Its up to you to determine how those are relevant but both popularity and the other characteristic(s) must have some impact.
2.3 Electorates
You need to determine appropriate components to represent the electorates. Each will have a political stance distribution rather than a specific stance. Its up to you to decide how this works. If you choose to trivialise it to being a single stance, as for the candidates and parties, you wont get full marks for this part.
2.4 Campaign days and events
Each day of the campaign involves the candidates and leaders attempting to convince the electorates to support them.
Each campaign will receive funding based on the effectiveness of their financial manager and the support for the party. That funding will be spent on the campaign and the impact should be some function of the campaign managers. Campaign managers should determine how much to spend under the assumption that they aim to use all their money by the last day of campaigning, with the restriction that they cannot spend money on the day it comes in.
On every day of the campaign, for each electorate, there is a 20% chance of a local event:
- Local debate.
- Candidate related event. You need two different types of these events.
- Local issue impact event. You need two different types of these events.
Local events only have an impact within an electorate. Candidates and campaign managers will have some impact on the outcomes.
On every day of the campaign there is a 30% chance of a national event:
- Leaders debate.
- Leader related event. You need two different types of these events.
- National issue impact event. You need two different types of these events.
National events should have some impact across all electorates. Leaders and national campaign managers will have some impact on the outcomes.
It is up to you to determine the likelihood of individual events but they should be weighted towards less significant events. You should describe the events and their impact in your report.
Each campaign day APE should report the day, what has happened in each electorate, and the significant impacts that have occurred. APE should also report the finances of each party at the end of each day, so initial, income, expenditure, and final.
2.5 Election day and wrapping up
Immediately prior to election day you should report on each party, so their stance values and the relevant details of their candidates, leader, and other significant figures.
You also need to report on the state of the nation, so give details on the electorates including population and stance distribution.
For each candidate you need to provide the breakdown of votes and identify the winner, so the candidate with the most votes.
You then need to provide a national summary, so how many electorates have been won by each party. If a party has won more than 50% of the electorates, they will form a government and you can report the party leader as the new leader for the country. If no party has won more than 50% of the electorates, APE should declare a hung parliament.
Reviews
There are no reviews yet.