Results 1 to 14 of 14
  1. #1
    Michael_25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    8

    Exclamation Assignment


    Develop an algorithm or write pseudo code to determine the winning party for this constituency in the national elections. The algorithm must accept as input (into two arrays) the party acronyms and the number of votes each party received at each of the polling stations in the constituency. The successful party is the one who received the most votes.


    Print the name of the winning party and the number of votes received.


    The above statement is an IT assignment to find the winning party and display his/ her result. I've created the test data to this but from here I'm lost can you please help me.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Let's start by asking you what your plan is?

    You got the assignment. You say you have test data --why don't you show us some and tell us where it fits in your plan?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    This is school homework for what class? We don't like to do anyone's homework. If you had attempted something and posted for analysis, could get productive feedback.

    An odd assignment for a relational database course. A query on a table could easily generate these stats and no VBA required.

    If you're lost then maybe need more guidance from instructor. Don't you have a textbook? Do some research.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Michael_25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    8

  5. #5
    Michael_25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    8
    Sorry for the late reply computer freeze up on me. Anyway the trace table you would see, the question that applies to it says to design and execute a trace table that used the data in the above file I sent and trace the increase in votes by each party. The last part show how far I've reached in the program and where I am stock on.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    ?? Please tell us what these pdf files represent regarding your effort. It isn't clear to me.

  7. #7
    Michael_25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    8
    The file was duplicated sorry bout that, the first table you see is what I have to use to create a pseudo code that will determine the winning party for a constituency I choose in the national elections. And with that data after creating the pseudo code I have to that data in designing a trace table that will trace the increase in votes obtain for each party. So far I've started the development of the pascal program but I don't know how to finish it. That's where I need your help.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  9. #9
    Michael_25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    8
    scroll down to the last page that is page 3

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    These few comments might be helpful.
    Program Winning_Pary;
    Var
    cnt, flag, finish: interger;
    Ig: interger;
    Ig: string
    PartyName: string;
    Votes: array[1..FINISH] of integer;
    Party Acronym: array[1..FINISH] of string;
    Begin
    Flag:= 0;
    Count:=1;
    Ig:=0;
    Votes:=0;
    ''' You need to get Votes per Party'''''' You have the Array????
    ''' How many Party(s) are involved??'''' Must iterate the Array(Party(s))

    While Votes <> Finish do
    Begin
    If Votes[cnt]>Ig then
    Writeln(‘information set flag’);
    Ig:= ‘winner’
    Ig:= ‘votes ‘;

    Good luck.

  11. #11
    Michael_25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    8
    Thank you very much.

  12. #12
    Michael_25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    8
    The reason for the array is that I need to find the party with the highest votes and display that party as the winner of the election. My teacher suggested that we use a while loop in that underneath the table had the word finish. Also to mention to you Three parties are involved and that they are divided up in a constituency. In this constituency It will have 11 polling stations where each citizen go to exercise there vote.

  13. #13
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Did you modify your pseudo code to make use of Party Acronym?

  14. #14
    Michael_25 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    8
    What do you mean?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Assignment
    By IsaacA95 in forum Access
    Replies: 1
    Last Post: 08-28-2013, 01:09 PM
  2. Help Designing a database for a school assignment
    By nl49 in forum Database Design
    Replies: 1
    Last Post: 02-10-2013, 07:18 AM
  3. Vehicle inventory/assignment
    By jzacharias in forum Database Design
    Replies: 2
    Last Post: 10-11-2012, 02:39 PM
  4. Not lookup, but assignment
    By ArmyLT in forum Database Design
    Replies: 3
    Last Post: 11-17-2011, 02:35 PM
  5. Project Assignment Database
    By flsticks in forum Access
    Replies: 3
    Last Post: 08-10-2010, 10:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums