ASSIGNEMENT:
ICS 340 Spring 2021 Programming Project There will be one multi-deliverable Java programming project this semester, which will be divided into three separately-graded program deliverables (DelivA through DelivC). A specification for each deliverable will be uploaded to D2L. Each deliverablc will build on past deliverables. Start from a Working Program Some Java programs work on student computers but not on University lab (Windows) computers or grading computer. So this semester, you are given an initial codebase, "Prog340", that seems to compile and run on all platforms. It opens a menu for you to select an action. It has a number of predefined menu items describing the various actions (which you will implement during the semester). When you start the program the first action you will want to take will be to read a file. The input files for all deliverables have the same, specified format. It allows you to continuously select actions as long as you wish o Including read another file. It allows you to exit the program. Each Deliverable will involve your modifying your existing program (DelivA involves modifying the initial program given to you). This minimizes any duplicate effort. But it means that if you screw up a deliverable, you may have screwed up another deliverable later in the course. . Grading Deliverable A is worth 25 points. It is pretty simple if you understand 00 programming in Java. For each of Deliverables B (50 pts) and C (55 pts): Correct functioning of the program is worth 40 and points (DelivB and DelivC). You will receive a set of test files which will be used to evaluate the program. Some other test files may also be used that are not given to you (in real life, you design to the specification, you can't test everything). You will receive the desired output for at least one test file. Part of Icarning the material in the class is figuring out the correct answer to the test files yourself. The correctness points are divided among the tests. For instance, if there are 8 tests, each test is worth 10 points. Normally, a test is either all or nothing, 0 or max points, but you can get substantial partial credit for output whose content is correct, but whose formatting is off. For Deliverable C, there will be a report worth 5 points. Program Architecture The initial program reads a text file and interprets it as a graph. Input File All the input files in this course will look something like this, file AB0.txt. Note that are separated by 1 or more spaces (not tabs): mns of data ICS 340 Spring 2021 AAA C val 67 BB > 999 3 Alfa Bravo Charlie Delta Echo -42 4 22 DDD E 99 fig yz 9 ! 2 33 3 4e yes . The first row is a header row. o The first -" is merely a placeholder. All files will have this at the beginning of the header row. "val" is a column label for the column of node values. The rest of the strings are mnemonics for the nodes of the graph. They are alphanumeric and do not contain spaces. Each subsequent row describes one node and its outgoing edges. o The first column contains the name of the node (e.g., "Alfa") The string in the "val" column is the value of the node, which may be numeric, but which will certainly always consist of a string of printable characters. The character *_* by itself stands for "no value". (e.g., node "Charlie" has no value.) For the rest of the columns, if there is no edge going from the node to another node, there is a "_" in the appropriate column. (e.g., there is no edge from node "Charlie" to node "Alfa".) If there is anything else in that column, that is the label of the edge. For some deliverables, this will be numeric, for others it may not be. Note that self-edges are allowed. o If you like a picture of what this is, here's what the above table looks like in graphical form: 33 Echo yes AAA 12 X 17 99 DDO Delta le 22 BB Bravo 67 Charlie ICS 340 Spring 2021 Program Classes and Methods There are 4 classes in the program given to you in addition to a sub class for each deliverable, A-C): Prog340 is the main class, which handles the I/O. Graph is a class whose objects represent graphs. Node is a class whose objects represent nodes (a.k.a., vertices) in the graph. Edge is a class whose objects represent edges (a.k.a., arcs) between nodes of the graph. Note that each edge has a direction. It goes from one specific node to another specific node. Here is a basic UML class diagram for these four classes. All methods and attributes are listed explicitly rather than using composition connectors, to be easily understood by people with little UML background. Prog340 File inputFile File outputFile Print Writer output JFileChooser fileChooser Graph g String[] comboBoxList Graph ArrayList
nodeList ArrayList get NodeList() ArrayList getEdgeList() void add Nodel Node) void add Edge Edge) String toString() Prog 3400) void main() void createAndShowGUIO void actionPerformed Actino Event) void read Graphinfo() Edge String label Node tail Node head Node ArrayList outgoing Edges ArrayList -42 4 22 Alfa Bravo Charlie Delta 3 X yz 3 4e yes 9 !=2 33 Echo d>e The output for this file should be: Edge from Alpha to Bravo labeled >. Edge from Alpha to Delta labeled 99. Edge from Alpha to Echo labeled fig. Edge from Bravo to Alpha labeled 999. Edge from Bravo to Bravo labeled -42. Edge from Bravo to Charlie labeled 3. Edge from Bravo to Delta labeled x. Edge from Bravo to Echo labeled == . Edge from Charlie to Bravo labeled 4. Edge from Charlie to Delta labeled yz. Edge from Charlie to Echo labeled 9. Edge from Delta to Alpha labeled 3. Edge from Delta to Bravo labeled 22. Edge from Delta to Charlie labeled x. Edge from Delta to Echo labeled !-2. Edge from Echo to Delta labeled d>e. Dage from Echo to Echo labeled 33. The order in which the Edges print out is not important. See the "prog340) spring2020.docx" file for details ICS 340 Program Deliverable A Spring 2021 Submit: Submit the Java source code to the open Deliverable A submission folder on D2L. You may submit either the source code or a full Eclipse package. You don't need to include test files. Test Files: Four test files are included with the deliverablc code basc - AB0.txt, A1.txt, A4.txt, ABD6.tr. These will be used to test and grade your deliverable, but additional test files may also be used, if needed. Grading: This deliverable is worth 25 points. There are 4 test files (AB0.1X1, A1.txt, A4.txt, ABD6.txt). Correct output for each test file is worth 5 points, Proper documentation, and doing the work with minimal disruption to the existing codebase (design") are worth 3 and 2 points respectively. Due Dates: The program is due on Jan 29th at 2 pm in the D2L Deliverable A" dropbox. ICS 340 Spring 2021 Programming Project There will be one multi-deliverable Java programming project this semester, which will be divided into three separately-graded program deliverables (DelivA through DelivC). A specification for each deliverable will be uploaded to D2L. Each deliverablc will build on past deliverables. Start from a Working Program Some Java programs work on student computers but not on University lab (Windows) computers or grading computer. So this semester, you are given an initial codebase, "Prog340", that seems to compile and run on all platforms. It opens a menu for you to select an action. It has a number of predefined menu items describing the various actions (which you will implement during the semester). When you start the program the first action you will want to take will be to read a file. The input files for all deliverables have the same, specified format. It allows you to continuously select actions as long as you wish o Including read another file. It allows you to exit the program. Each Deliverable will involve your modifying your existing program (DelivA involves modifying the initial program given to you). This minimizes any duplicate effort. But it means that if you screw up a deliverable, you may have screwed up another deliverable later in the course. . Grading Deliverable A is worth 25 points. It is pretty simple if you understand 00 programming in Java. For each of Deliverables B (50 pts) and C (55 pts): Correct functioning of the program is worth 40 and points (DelivB and DelivC). You will receive a set of test files which will be used to evaluate the program. Some other test files may also be used that are not given to you (in real life, you design to the specification, you can't test everything). You will receive the desired output for at least one test file. Part of Icarning the material in the class is figuring out the correct answer to the test files yourself. The correctness points are divided among the tests. For instance, if there are 8 tests, each test is worth 10 points. Normally, a test is either all or nothing, 0 or max points, but you can get substantial partial credit for output whose content is correct, but whose formatting is off. For Deliverable C, there will be a report worth 5 points. Program Architecture The initial program reads a text file and interprets it as a graph. Input File All the input files in this course will look something like this, file AB0.txt. Note that are separated by 1 or more spaces (not tabs): mns of data ICS 340 Spring 2021 AAA C val 67 BB > 999 3 Alfa Bravo Charlie Delta Echo -42 4 22 DDD E 99 fig yz 9 ! 2 33 3 4e yes . The first row is a header row. o The first -" is merely a placeholder. All files will have this at the beginning of the header row. "val" is a column label for the column of node values. The rest of the strings are mnemonics for the nodes of the graph. They are alphanumeric and do not contain spaces. Each subsequent row describes one node and its outgoing edges. o The first column contains the name of the node (e.g., "Alfa") The string in the "val" column is the value of the node, which may be numeric, but which will certainly always consist of a string of printable characters. The character *_* by itself stands for "no value". (e.g., node "Charlie" has no value.) For the rest of the columns, if there is no edge going from the node to another node, there is a "_" in the appropriate column. (e.g., there is no edge from node "Charlie" to node "Alfa".) If there is anything else in that column, that is the label of the edge. For some deliverables, this will be numeric, for others it may not be. Note that self-edges are allowed. o If you like a picture of what this is, here's what the above table looks like in graphical form: 33 Echo yes AAA 12 X 17 99 DDO Delta le 22 BB Bravo 67 Charlie ICS 340 Spring 2021 Program Classes and Methods There are 4 classes in the program given to you in addition to a sub class for each deliverable, A-C): Prog340 is the main class, which handles the I/O. Graph is a class whose objects represent graphs. Node is a class whose objects represent nodes (a.k.a., vertices) in the graph. Edge is a class whose objects represent edges (a.k.a., arcs) between nodes of the graph. Note that each edge has a direction. It goes from one specific node to another specific node. Here is a basic UML class diagram for these four classes. All methods and attributes are listed explicitly rather than using composition connectors, to be easily understood by people with little UML background. Prog340 File inputFile File outputFile Print Writer output JFileChooser fileChooser Graph g String[] comboBoxList Graph ArrayList nodeList ArrayList get NodeList() ArrayList getEdgeList() void add Nodel Node) void add Edge Edge) String toString() Prog 3400) void main() void createAndShowGUIO void actionPerformed Actino Event) void read Graphinfo() Edge String label Node tail Node head Node ArrayList outgoing Edges ArrayList -42 4 22 Alfa Bravo Charlie Delta 3 X yz 3 4e yes 9 !=2 33 Echo d>e The output for this file should be: Edge from Alpha to Bravo labeled >. Edge from Alpha to Delta labeled 99. Edge from Alpha to Echo labeled fig. Edge from Bravo to Alpha labeled 999. Edge from Bravo to Bravo labeled -42. Edge from Bravo to Charlie labeled 3. Edge from Bravo to Delta labeled x. Edge from Bravo to Echo labeled == . Edge from Charlie to Bravo labeled 4. Edge from Charlie to Delta labeled yz. Edge from Charlie to Echo labeled 9. Edge from Delta to Alpha labeled 3. Edge from Delta to Bravo labeled 22. Edge from Delta to Charlie labeled x. Edge from Delta to Echo labeled !-2. Edge from Echo to Delta labeled d>e. Dage from Echo to Echo labeled 33. The order in which the Edges print out is not important. See the "prog340) spring2020.docx" file for details ICS 340 Program Deliverable A Spring 2021 Submit: Submit the Java source code to the open Deliverable A submission folder on D2L. You may submit either the source code or a full Eclipse package. You don't need to include test files. Test Files: Four test files are included with the deliverablc code basc - AB0.txt, A1.txt, A4.txt, ABD6.tr. These will be used to test and grade your deliverable, but additional test files may also be used, if needed. Grading: This deliverable is worth 25 points. There are 4 test files (AB0.1X1, A1.txt, A4.txt, ABD6.txt). Correct output for each test file is worth 5 points, Proper documentation, and doing the work with minimal disruption to the existing codebase (design") are worth 3 and 2 points respectively. Due Dates: The program is due on Jan 29th at 2 pm in the D2L Deliverable A" dropbox