diff --git a/src/Assignments/A2/Substrings.java b/src/Assignments/A2/Substrings.java index de26dc3..97992f7 100644 --- a/src/Assignments/A2/Substrings.java +++ b/src/Assignments/A2/Substrings.java @@ -67,11 +67,16 @@ import java.util.Scanner; */ public class Substrings { + /** + * Starts the program. + * @param args the program arguments. + */ public static void main(String[] args) { Substrings program = new Substrings(); program.start(); } + /* Private fields that store the text, and results from the algorithm */ private String text; private int subStringCount; private int comparisons; @@ -121,10 +126,12 @@ public class Substrings { * @postcondition the results are generated. */ private void performAlgorithm() { + /* Resets the counters to prevent them being added on reruns */ this.subStringCount = 0; this.comparisons = 0; - char[] values = this.text.toLowerCase().toCharArray(); + /* Allows to grabbing specific values are certain indexes. */ + char[] values = this.text.toLowerCase().toCharArray(); for (int i = 0; i < this.text.length(); i++) { if (values[i] == 'a') { for (int j = i+1; j < this.text.length(); j++) {