please help me

Discussion in 'Java' started by alaa sham, May 25, 2012.

  1. alaa sham

    alaa sham

    Joined:
    May 25, 2012
    Messages:
    1
    i have very difficult homework , can you help me ,please
    We want to write a program to calculate the electoral votes of a number of candidates running as follows:
    The program requires input the total number of candidates. Then ask enter the names of the candidates.
    After being introduced as numbers correct sounds positive, represents the numbers of candidates, the introduction ends with the vote number 0.
    Required of the program show the following results:
    - The number of votes obtained by each candidate
    - The percentage of votes for each candidate
    - The smallest number of votes
    - The largest number of votes
    - The name (or names) of candidates obtaining the largest number of votes
    Example for the implementation of the program: (income and output in blue in red)
    Number of Candidates: 5
    Name of Candidate 1: Ahmad
    Name of Candidate 2: Ryad
    Name of Candidate 3: Houssam
    Name of Candidate 4: Khaled
    Name of Candidate 5: Zyad
    Voice for: 1
    Voice for: 2
    Voice for: 2
    Voice for: 1
    Voice for: 1
    Voice for: 3
    Voice for: 4
    Voice for: 5
    Voice for: 3
    Voice for: 2
    Voice for: 2
    Voice for: 2
    Voice for: 3
    Voice for: 3
    Voice for: 3
    Voice for: 1
    Voice for: 2
    Voice for: 3
    Voice for: 2
    Voice for: 3
    Voice for: 5
    Voice for: 2
    Voice for: 3
    Voice for: 2
    Voice for: 3
    Voice for: 0

    Ahmad 4 0.1538462
    Ryad 9 0.3461539
    Houssam 9 0.3461539
    Khaled 1 0.03846154
    Zyad 2 0.07692308

    minimum votes = 1
    maximum votes = 9

    First Candidates are:
    Ryad
    Houssam
     
    alaa sham, May 25, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JC
    Replies:
    4
    Views:
    8,034
    Jeff C
    Jul 8, 2004
  2. casioculture@gmail.com
    Replies:
    4
    Views:
    571
    Chris Uppal
    May 5, 2005
  3. KK
    Replies:
    2
    Views:
    732
    Big Brian
    Oct 14, 2003
  4. MuZZy
    Replies:
    7
    Views:
    1,830
    Mike Hewson
    Jan 7, 2005
  5. mera
    Replies:
    7
    Views:
    1,159
Loading...

Share This Page