Camel case.
This commit is contained in:
parent
ca2b85ef9e
commit
2494bea36c
|
@ -2,19 +2,19 @@ import java.util.Scanner;
|
||||||
|
|
||||||
public class lab_1 {
|
public class lab_1 {
|
||||||
|
|
||||||
public static int protectedInput(String variable_to_read, Scanner input) {
|
public static int protectedInput(String variableToRead, Scanner input) {
|
||||||
int read_variable;
|
int readVariable;
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
System.out.printf("Enter %s: ", variable_to_read);
|
System.out.printf("Enter %s: ", variableToRead);
|
||||||
read_variable = input.nextInt();
|
readVariable = input.nextInt();
|
||||||
break;
|
break;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.printf("%s must be an integer.\n", variable_to_read.toUpperCase());
|
System.out.printf("%s must be an integer.\n", variableToRead.toUpperCase());
|
||||||
input.nextLine();
|
input.nextLine();
|
||||||
}
|
}
|
||||||
} while (true);
|
} while (true);
|
||||||
return read_variable;
|
return readVariable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
Loading…
Reference in New Issue