Election Program help!

So I am once again back and asking for help! This is my final lab of the semester, and I really have no idea what to do after a certain point. My professor isn't much help. I just need some guidance on this last lab! Here's the prompt:
Instructions

Barry works at the local election office, and he is requesting a program that provides election statistics. Barry wants this program to input information from a file on the hard disk and processes the information to view results. He wants the following commands implemented:

1. Candidate Vote Count Lookup – Asks the user for the last name of a candidate and outputs the number of votes he/she received.
2. Get Election Winner – Returns the winner of the election.
3. Display Election Statistics - Displays the statistics of the election, which includes the following information:
a. The last name of the candidate.
b. The number of votes each candidate in the election received.
c. The percentage of total votes each candidate received.
d. The total number of votes casted for the election.
e. The average number of votes all candidates received.
4. Exit Program

This program will work by importing the election statistics into two separate arrays:
· 1 that will hold the candidate’s names.
· 1 that will hold the candidate’s votes.
The file I/O and creating/storing of array information will be handled for you.
You will be given a starter file, and your task will be to complete the empty functions, where there will be 1 function for each of the menu commands. Each function will accept both arrays as input and output the results.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  #include <iostream>
#include <iomanip>
using namespace std;

void menu(){
    cout << "Main Menu" << endl;
    cout << "1. Canidate Cout Lookup" << endl;
    cout << "2. Get Election Winner" << endl;
    cout << "3. Display Election Statistics" << endl;
    cout << "4. Exit Program" << endl;
}
int countLookUp()
{
    cout << "Enter your candidate's late name: " << endl;
    int candidate;
    cin >> candidate;
    
    return candidate;
}


I am just so confused on what to do. I know how to make a working menu, but as for everything, I am completely lost.
read the instructions, break it down, what do you need?
When I do that, it leaps out that you need a container that you can access from candidate name that stores the # of votes they have. If you wanted to get fancy, you can put that inside an object and store the tangential info like total # of votes.

part e makes no sense to me. if there are 2 candidates, the average is 50% even if one got 99% and the other 1%.
I forgot to mention that he does give us a text file with the candidates and how many votes they got. I am confused on how to do any of it really. My professor kind of sucks and doesn't teach us how to do things. He also wants us to use arrays in this problem.
Topic archived. No new replies allowed.