Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


CS 2820 Introduction to Software Development

Spring 2022


Individual Assignment.

60 points: This assignment will help familiarize you with using Eclipse to write and debug code. You will use the Eclipse to refactor WorkLoadDescription.java so that it can be tested as a stand-alone class.

Instructions follow.

1) Create a new HW1 branch from the command line in your Git repository and work from that branch.

a. git branch HW1

b. git checkout HW1

2) Add public static void main(String[] args) method at the bottom of the class with the following functionality:

a. Instantiate WorkLoadDescription with the parameter StressTest.txt

b. Print to the console

i. Graph Name: {name of graph in the file, sans the ‘{‘

ii. Each flow, preceded by the string ‘Flow k: ‘, where k is the flow number starting at 1, with the flows ordered in reverse-alphabetical order by their name. That is, F5 will be printed before F2. (Note, however, ordering the flows alphabetically is not the same as ordering them numerically, which is what I have usually done in the graph .txt files when creating the flows.) Example output:

StressTest
Flow 1: F9 (9, 100, 100, 0) : A -> B -> C -> D -> E -> J -> K -> L
Flow 2: F8 (8, 100, 100, 0) : C -> D -> E -> F -> G -> H -> I
Flow 3: F7 (7, 100, 100, 0) : A -> B -> C -> D -> E
Flow 4: F6 (6, 75, 75, 0) : B -> C -> D
Flow 5: F5 (5, 75, 75, 0) : A -> B -> C -> D -> E
Flow 6: F4 (4, 75, 75, 0) : A -> B -> C -> D -> E -> J -> K -> L
Flow 7: F3 (3, 50, 50, 0) : C -> D -> E -> J -> K -> L
Flow 8: F2 (2, 50, 50, 0) : C -> D -> E -> F -> G -> H -> I
Flow 9: F10 (10, 100, 100, 0) : C -> D -> E -> J -> K -> L
Flow 10: F1 (1, 20, 20, 0) : B -> C -> D
Flow 11: AF5 (5, 75, 75, 0) : M -> N -> O -> P -> Q
Flow 12: AF4 (4, 75, 75, 0) : M -> N -> O -> P -> Q -> V -> W -> Y
Flow 13: AF2 (2, 50, 50, 0) : O -> P -> Q -> R -> S -> T -> U
Flow 14: AF10 (11, 100, 100, 0) : O -> P -> Q -> V -> W -> Y
Flow 15: AF1 (1, 20, 20, 0) : N -> O -> P

3) Run the program with Eclipse by creating a new run configuration that launches your new test case.

4) Test your program works correctly with the other graph .txt files in your repo, but be sure the final version of WorkLoadDescription.java tests the file StressTest.txt.

5) Commit and push your corrected code to your HW1 branch repository. Be sure to follow the on-screen instructions to push the HW1 branch to the upstream (remote) branch. But you can ignore the instructions to create a merge request via the URL.

6) Merge your HW1 branch with the main branch (but do not delete the HW1 branch):

a. git checkout main

b. git merge HW1

c. git push

7) Via the ICON assignment, submit the URL to your repository.

Your TA will evaluate your assignment by pulling your files from your HW1 branch repository.

HINT: I suggest you use the Collections.sort() method in the java.util.Collections library to sort your data structure.

The assignment will be scored at follows:

HW1 branch repository                             10 pts

Code algorithm, style, and comments         25 pts

Correct output                                         25 pts