Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Elli (50) adayn katld bir bakanlk seiminde bilgisayardan oylama yaptrlarak, kazanan aday bulunmak istenmektedir. Oy veren kii, 1-50 arasnda bir aday numarasn klavyeden girerek hangi
Elli (50) adayn katld bir bakanlk seiminde bilgisayardan oylama yaptrlarak, kazanan aday bulunmak istenmektedir. Oy veren kii, 1-50 arasnda bir aday numarasn klavyeden girerek hangi adaya oy verdiini belirtmektedir. Oylama srecini, klavyeden girilen -1 deeri sonlandrmaktadr. Buna gre, adaylarn her birinin ka oy aldn ve aada tanm verilen kazananiBul fonksiyonunu kullanarak en ok oyu alan adayn numarasn, ald toplam oy says ile beraber ekranda grntleyen C programn yaznz .
kazananiBul fonksiyonu, parametre olarak her adayn ka oy aldn saklayan bir dizi almal ve en fazla oya sahip adayn numarasn geri dndrmelidir.
Fifty (50) candidates participate in a presidential election by computer voting, the winning candidate is asked to be found. The person who votes indicates which candidate they voted for by entering a candidate number between 1-50 from the keyboard. The -1 value entered from the keyboard ends the voting process. Accordingly, write the program C, which displays how many votes each of the candidates received and the number of the candidate who received the most votes using the winning function defined below, along with the total number of votes he received .
the winning function must take a set as a parameter that stores how many votes each candidate received, and return the number of the candidate with the most votes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started