Interpret object-oriented application programming


Learning Objectives:

• To demonstrate your ability to interpret object-oriented Application Programming Interface documentation.

• To develop your skills in writing classes in an object-oriented programming language.

• To develop you; skills in designing a suite of unit rests.

• To demonstrate your ability_ to develop program code that Interfaces with code written by others.

• To demonstrate your ability to write clear, understandable program code

The Scenario — Counting the Votes:

This year is a big one for active democracy if you happen to live in Queensland. Shortly we have local government elections across the state. and sometime later in the year —probably in Semester 2 — there will be a federal election for the House of Representatives, and quite possibly for the entire Senate as well, depending on how lucky the Prime Minister is feeling at the time'.

In this project it is our intention to automate the vote counting for a single House of Representatives (HoR) seat (we may also use the equivalent terms electorate, electoral district, and constituency). We will employ the standard approach, but we also look at how this might work if the system happened to be different. Those who want or feel they need a general overview of the Australian parliamentary system can fed one here:

http:hlwww.peo.zov.att'auick-amwenthe---enate-and-the-hott:e-of-repre--entative:Itml

The essential ideas are described in the examples below.

This section has a lot of (mostly straightforward) background. some of which may be unfamiliar to international students and locals who are not political junkies. Look at this material carefully and listen to the podcasts as they become available.

But this is what software developers have to do. to understand a practical problem and then desien and code a solution for it. In this case. as our focus is on testing. a lot of the work has already been done for you. But you can't test if you don't understand the problem domain. So there is no escaping the background material You will need to come to grips with two different systems: simple majority voting. and preferential voting There is a third wrinkle. an approach called optional preferential wring. which we will mention below for the sake of completeness. but vou won't have to manage_

Simple Voting and Preferential Voting

Simple or first past the post voting is easy to understand N candidates nominate for election_ people get to vote for the candidate they want. and the candidate with the most votes inns. The example here is fake. but is based on the surge of support for Ted Cruz in the L'S Republican contests over the weekend of March 5-6 Suppose we had 1.000.000 voters deciding between Trump. Rubio. Cruz and Kasich (not all of whom are guaranteed to be still in the race by the time you read this [Editor's note: Yep. that was right ]). with a vote count as follows:

Name    Votes
Trump    400,000
Rubio      100000
Cruz       420000
Kasich      80000
            1000000

Here Cruz would win (as he did in the state on which this is based) as he has the highest share of the vote. with Trump the obvious competition just behind. The 180.000 who voted for Kasich or Rubio have m this sense wasted their votes — they are no longer in the contest. which is between Trump and Cruz.

The idea of preferential voting is to elect the candidate most acceptable to the majority of people. even if they don't elect their first choice. To simplify a little. suppose that we were to ask the people who voted for Rubio (and for Kasich) a simple question: If you had a choice between Trump and Cruz. which one would you pick? Let us suppose for the sake of argument (based on the politics. the figures are unrealistic) that the results were as follows:

Name    Trump    Cruz           Total
gt. t lo    65,000    35,000    100,000
Kasich    45,000    35,000     80,000
Total    110,000    70,000    180,000

If we were to bring these votes back into play. and to give them to the voters' next choice. we would see that Trump would be the big winner The rwo candidate preferred vote — the vote we get if we add these votes to the origmal (ptinfact or first preference) votes that Trump and Cruz received — is then as follows:

Name    Votes
Trump    510,000
Cruz      490,000
           1,00Q000

and we see that Trump has gone from 20.000 votes behind to 20.000 votes in front. and would be the new winner after the dimriburion of preferences.

The Australian System:

The true algorithm r more complicated. and involves eliminating in turn the poorly supported candidates and re-assigning their votes to those remaining_ The Parliamentary Education Office has a worked example as follows:

2112_Preferential voting.jpg


Attachment:- VotingWizard.rar

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Interpret object-oriented application programming
Reference No:- TGS01238403

Expected delivery within 24 Hours