Fixed some formatting. Pending review.
This commit is contained in:
parent
6b620cf0a1
commit
06407ae8bf
@ -59,15 +59,20 @@ import java.util.Scanner;
|
|||||||
|
|
||||||
public class AnagramsCheck {
|
public class AnagramsCheck {
|
||||||
|
|
||||||
|
// Starts the program.
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
AnagramsCheck program = new AnagramsCheck();
|
AnagramsCheck program = new AnagramsCheck();
|
||||||
program.start();
|
program.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Field variables
|
||||||
private String first;
|
private String first;
|
||||||
private String second;
|
private String second;
|
||||||
private int comparisons;
|
private int comparisons;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the sentinel loop by getting an option, executing it, and getting another until exit option.
|
||||||
|
*/
|
||||||
public void start() {
|
public void start() {
|
||||||
int option = getOption();
|
int option = getOption();
|
||||||
while (option != 3) {
|
while (option != 3) {
|
||||||
@ -173,7 +178,6 @@ public class AnagramsCheck {
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs the algorithm in checking if two strings are anagrams.
|
* Performs the algorithm in checking if two strings are anagrams.
|
||||||
* It accomplishes this by first removing casing and spacing from the strings.
|
* It accomplishes this by first removing casing and spacing from the strings.
|
||||||
|
@ -53,6 +53,7 @@ package Assignment1;
|
|||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class LockerDoors {
|
public class LockerDoors {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the program and begins the sentinel loop.
|
* Starts the program and begins the sentinel loop.
|
||||||
*/
|
*/
|
||||||
@ -77,7 +78,6 @@ public class LockerDoors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints out the menu of options, asks for an input, and if that input is invalid it prints an error and
|
* Prints out the menu of options, asks for an input, and if that input is invalid it prints an error and
|
||||||
* prompts the user again for the input.
|
* prompts the user again for the input.
|
||||||
@ -111,7 +111,6 @@ public class LockerDoors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method executes the option based on that which was provided in the parameters.
|
* This method executes the option based on that which was provided in the parameters.
|
||||||
* This method prevents any option from running (Ex. Option 2) until all preconditions have been met.
|
* This method prevents any option from running (Ex. Option 2) until all preconditions have been met.
|
||||||
@ -168,8 +167,6 @@ public class LockerDoors {
|
|||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the menu options.
|
* Displays the menu options.
|
||||||
*/
|
*/
|
||||||
@ -203,7 +200,6 @@ public class LockerDoors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Made my locker list easier to follow by toggling.
|
// Made my locker list easier to follow by toggling.
|
||||||
class Locker {
|
class Locker {
|
||||||
public boolean isOpen;
|
public boolean isOpen;
|
||||||
|
Loading…
Reference in New Issue
Block a user