Assignment A project is comprised of one or more sequential phases. Each phase is comprised of one or more tasks. Each phase must be completed before the next one can begin. However, the different tasks belonging to a single phase can be carried out concurrently. The time it takes to complete a phase is the time needed to complete the longest task in that phase. You are to write a program that analyzes the phases of a project and provides a summary of the time frames for the phases and the entire project. The program will read the information regarding the project phases and tasks from an input file. The output of the program should be directed to the standard output device. The Input File You are to create a test input file using a standard text editor. Each line of the file contains an phase number, a task number, and the number of days required to complete the task. All values should be integers and the values on each line should be separated by a space. The data are stored such that all the tasks for phase 1 are followed by all the tasks for phase 2, and so on. A typical data file for a project might contain the following data: 1 100 6 1 110 4 2 120 5 3 130 4 3 140 1 4 150 2 4 160 3 4 170 3 5 180 2 5 190 12 6 200 5 So, for example, phase 3 for this project is comprised of two tasks. The time needed to complete phase 3 is four days (the length of the longest task for phase 3). The Output The program should print a project timetable summary that lists each phase number, a count of the number of tasks within the phase, the maximum number of days for a task within the phase, and the total number of days for the project completion. An example might be: PROJECT COMPLETION TIMETABLE PHASE / NUMBER OF TASKS / MAX TASK LENGTH ----- --------------- --------------- 1 / 2 / 6 2 / 1 / 5 3 / 2 / 4 4 / 3 / 3 5 / 2 / 12 6 / 1 / 5 Days for project completion: 35 Requirements • You must prompt the user for a file name and you must read your input values from that file. • You must detect failures in opening the input file. • You must use end of file detection to determine when to stop reading from the file. Do not loop through a fixed number of times. |
|
|
|
|
phase number / (the count of steps in this phase) / (the max value for this phase)
|
|
7 / 5 / 543
because phase 7 has 5 lines of steps, and the maximum value for the last column is 543.