Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a stored Procedure called PreferenceDistribution() The result should count the number of votes casted, if the candidate got more than 50% of the vote,

 

Create a stored Procedure called PreferenceDistribution()

The result should count the number of votes casted, if the candidate got more than 50% of the vote, it should win the election. The round should be based on how many the candidates are competing. Lets assume there are (n) number of candidates, then there should be (n-2) rounds.

The stored procedure should show the number of round, the name of the candidates, and how many votes they got on the round, the candidate with least vote will be eliminated and the number of votes the eliminated candidate has will be redistributed to the candidate that are still standing based on the preferences.

ID PREF1 123 Amy Wong 234 Sam Andrew 345 Sam Andrew 456 Philip Will 567 Amy Wong ELECTIONS ELECTION ID STATE 20 California 21 Florida 22 Utah 23 Colorado PREF2 Judson Mack Amy Wong Amy Wong Amy Wong Judson Mack CAST VOTING PAPER PREF3 Sam Andrew Fanny Thrung Fanny Thrung Sam Andrew Sam Andrew Prefrence Distribution() ROUND 1 Amy Wong Sam Andrew Philip Will Judson Mack Fanny Thrung PREF4 Fanny Thrung Judson Mack Philip Will Judson Mack Fanny Thrung ROUND 2 Amy Wong Sam Andrew Philip Will 22 PREF5 Philip Will Philip Will Judson Mack Fanny Thrung Philip Will 1 O ELIMINATED O ELIMINATED 5 -- 2+3 2--2+0 1 ELIMINATED ELECTIONID 23 23 23 23 23 (Amy got more than 50%, Amy Wins)

Step by Step Solution

3.36 Rating (149 Votes )

There are 3 Steps involved in it

Step: 1

1 Procedure SSSENH 2 3 4 Step 11 6 PreferenceDistribution Expl... 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

Canadian Income Taxation Planning And Decision Making

Authors: Joan Kitunen, William Buckwold

17th Edition 2014-2015 Version

1259094332, 978-1259094330

More Books

Students also viewed these Accounting questions

Question

Evaluate 3x - 1 / x - 1. lim

Answered: 1 week ago

Question

What is an after-tax approach to decision making?

Answered: 1 week ago