1. Problem Definition A critical-path analysis is a technique used to determine the schedule for a project. One method f
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1. Problem Definition A critical-path analysis is a technique used to determine the schedule for a project. One method f
When the user selects option 7, your program must ask the user to confirm whether he/she actually wants to exit the program (see the sample runs). No global variables are allowed in this assignment. Use parameter passing and decide on appropriate parameters to communicate between various functions in the program. Your program must include at least the following functions: 1
1) generateData(....): Fills the events, tasks and days lists with the required values. Your program should, initially, store ten values in each of the three lists. The events list should eventually contain sorted integer values in the range [1,5] and must include all the values 1 to 5. For this purpose, first, fill the list with the five values of 1 to 5. Then add to the list five random integer values in the range (1,5). Then, sort the list in ascending order. The tasks list should contain random integer values in the range [10,30] that are distinct for every event (i.e., no task value should be repeated for any event). The days list should contain random integer values in the range [1,9]. 2) displayMenu(): Prints the menu and returns the user's choice. 3) display AllTasks(...): Displays the events, tasks and days lists' values in a readable tabular format as shown in the provided sample runs. 4) computeLongestEvent(....): Returns the event number for the event with the longest duration (i.e., the event with the most time consuming task). 5) computeEventTime(....): Returns the number of days needed to complete the specified event. 6) computeProjectTime(....): Returns the total number of days needed for the project completion. 7) plotEventTimeChart(....): Displays an asterisk bar chart of the events completion times as illustrated in the given sample runs. 8) addNewTask(...): Prompts the user for a new task information (event number, task number and the number of days), verifies the new task information, and adds the valid new task information at the proper position in the event, task and days lists, so that the events list stays in its sorted form after the addition of the new task information. Confirm the addition of the new task. 9) main(): Defines the events, tasks and days list variables, and fills them with data using function generateData(...). Then, it repeatedly presents the menu to the user and handles various user choices. It calls various functions as needed.
3. Sample Run: (Refer to PA4SampeRunl.txt and PA4SampeRun2.txt for extensive sample runs) Critical Path Analysis Critical Path Analysis 1 - Duplay all IMRE 2. Find the event with locant duration - Compute the time to finish given avant 4- Compute project completion tim 5. Plot vant time chart ਦੀ ਤੋਂ ਵੀ ਵਾਲ : ਬN . 7- Exit pro - Diena Il Tanks 2. Find the event with langt duration 1- Compute the time to finish 4- Computer project completion ti - Plotti tim chart ME 7. Exit program Enter your choice: Invalid choice Inter your chale Critical Path Analysis Entervent number Invalid unt number into ant nu Invalid at number 1. Display all Tanks 2. Find the went with longent duration 1- Compute the time to finishen avant Compute project completion time 5. Plat sunt in chart Add new task 7. Exit program Interrumber 1 ut number 1 Embu completed in 1 day Critical Path Analyse inter your choice 1 tent Task Number of Days 1. Deplay all fade 2- Find the went with longue duration 1- compute the inte finth givant 1- Contact completion time 1 Platt ta Ant 7. Exit pro 3 2 2 Enter your chalez 5 Intar the nut Intention and take number nu of days Invalid new tatton 6 in the new uk Information avant um af days): 122 Invalid Intan itical Path analysis Display all Tasks ne the vat with lumut duration compte the time to tih in avant toute peasest olutta h કે એક સારા ના રાજા In the 9 a 12 mdr ur of days) 19 lastended E Critical Hath Analysis - Display all lasku Fina hvor - Casute the event CREE Blatt Mart Adana 1 ELE In your chal Critical Fath Analysis Ar you sure you wt ta ut the polication in Arvou sure you cut to suit the value la VAN Compute the time to the event Compute project completin tim FL Athly LL 1- blyplay 11 HE મક યાત્રા માં કામ મ મ મ મ મ મ માથ, Ecout the u un V 4- daudelatum , Plat varetur aan Enter your cho la pre Cinta analysis ------------- Екан унали как се the are EL Find us with largest nu Compute the time to takih . sive 4 - Compute projet completion Add tau 7= 11 1 adu 4 L + um AL LE That is the days En des you want the vella