please help me with this
Assignment:
Write a program that will read the critical path information from the attached file
(ProjectInfo.txt) into 3 arrays, events, tasks and numDays and defines a 4th array called
eventNumDays in which you will calculate the number of days needed for each event to
complete, the index of the array will represent the event number.
Part 2:(these are seperate functions that i have to write)
Create and implement a user driven menu with the following options:
1) Number of days for a given event
2) List tasks in given event
3) Sort events by number of days
0) Exit
Each of the menu options should behave as follows:
1. Number of days for a given event
Prompts the user to enter an event number and displays the number of days needed for
completion of that specific event.
2. List tasks in given event
Prompts the user to enter an event number and lists the tasks associated with the given event.
3. Sort events by number of days
Displays a list of events sorted in descending order of the number of days needed to complete
the event. This requires creating 2 new arrays: a copy of eventNumDays called
sortedEventNumDays and a sortedEvents array which is initialized with event numbers
sorted in descending order. Using a Selection sort that you learned in class, sort the
sortedEventNumDays array and move/switch element in the sortedEvents array
accordingly. Remember that the index of eventNumDays represent the event number.
Finally you display the sortedEvents array.
THIS IS WHAT I GOT SO FAR FOR NUMBER 1 BUT IT IS NOT WORKING OUT PLEASE HELP!!
int eventDays(int& n)
{
int events[MAX], numDays[MAX];
int m;
cout << "Please input an event number: ";
cin >> n;
m = events[n];
cout << "answer: " << m << endl;
return n;
}
please correct this for me!!