c++ problem

Hello every 1 !
How u do?
I hope everything going well..

I hv c++ homework and I start to do it but we faced some problems and couldn't solve it!
I will upload it with its question and I hope any 1 help us..

Thanks a lot..



This is the Question:

A critical-path analysis is a technique used to determine the schedule for a project. This information is important in the planning stages before a project is begun, and it is also useful to evaluate the progress of a project that is partially completed. One method for this analysis starts by dividing a project into sequential events and then dividing each event into various tasks. Although one event must be completed before the next one is started, various tasks within an event can occur simultaneously. The time it takes to complete an event, therefore, depends on the number of days required to finish its longest tasks. Similarly, the total time it takes to finish a project is the sum of the time it takes to finish each event.

Assume that the critical-path information for a major construction project has been stored in a data file named “project.txt” as illustrated in the following figure. Each line of the data file contains an event number, a task number, and the number of days required to complete the task. The number of tasks that are maintained in the file is unknown and the file can maintain information about up to 100 tasks.

Write a C++ program that performs the following:
(a) Read the critical-path information for a given construction project from “project.txt” file only once.
(b) Use three arrays to maintain the event number, task number and required days for each task.
(c) Then, it should repeatedly display the following menu and perform the corresponding task using the data maintained in the three arrays.
1- Display all tasks
2- Find the event with longest duration
3- Compute the time to finish a given event
4- Compute project completion time
5- Exit program

Your program must include at least the following functions:
1) readProjectTasks(eventList, taskList, daysList, …): reads the event number, task number and the number of required days for all tasks from “project.txt” file. It stores them into three arrays eventList, tasksList and daysList, respectively. The function should return the number of tasks that are maintained in the input file.
2) displayMenu(): Prints the menu, and verifies and returns the user’s choice.
3) displayAllTasks(eventList, taskList, daysList, …): Displays the list of all tasks in a readable tabular format as shown the sample run below.
4) computeLongestEvent(eventList, taskList, daysList, …): returns the event number for the event with the longest duration (i.e., the event with the most time consuming task).
5) computeEventTime(e, eventList, taskList, daysList, …): receives the event number e for a given event as an input parameter, and returns the time needed to complete the asks for event e. The function should return zero if no tasks were found for event e.

will be cont in next msg..
Topic archived. No new replies allowed.