Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

by using C (programming language) Within the scope of this project, election simulation software will be implemented. It will be assumed that there are 5

by using C (programming language)

Within the scope of this project, election simulation software will be implemented.

It will be assumed that there are 5 different provinces and 6 different parties throughout the country.

The valid votes of each party in each province and the quota of deputies given by each province will be entered by the user.

In the election simulation software developed, it is requested that the quota of deputies of the provinces be distributed among the parties according to the votes received by the parties.

The process of appointing deputies to provinces is done by the following method:

Step 1: First, 1 deputy is appointed to the party that receives the most votes in that province, and then the number of votes of that party is reduced by half. Step 1 must be repeated.

Step 3: All these processes must be repeated until the quota of deputies allocated by that number is exhausted.

According to this; the quota of deputies for each province, the number of valid votes, the number and percentage of votes received by the parties, the number of deputies issued by the parties; They should be listed in descending order according to the number of votes they have received.

One of the existing sorting algorithms in the literature can be preferred for the sorting process (For example:

Bubble Sort Algorithm or you can write your own algorithm.

After listing the results for a province, the user should be asked to press a button and the data for the next province should be listed.

After all provinces are finished, the total number of deputies for the country, the total number of valid votes, the total number and percentage of votes the parties have received, and the total number and percentage of deputies the parties have issued should be listed.

In addition, it should be listed which parties are the ruling and main opposition parties (according to the number of MPs) and in how many provinces the parties are the first party according to the number of votes.

It is expected to use at least three functions in the software.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions