-
-
Notifications
You must be signed in to change notification settings - Fork 5
Fix Ch. 14 Account practice problem, fix package name in Ch. 13 Negative Sum practice problem #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Consolidate into 1 class called Account.java - Clarify instructions and post instructions in the file - Close Scanner object when done
Fixed a couple identation things and formatting on the createAccount method where parameters are initialized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reviewdog
src/com/codefortomorrow/advanced/chapter14/solutions/Account.java|108 col 1| Top-level class PasswordMismatchException has to reside in its own source file.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|8| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|9| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|8| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|9| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|10| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|34 col 9| Javadoc comment is placed in the wrong location.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|8| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|9| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|8| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|9| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|10| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|30| Line is longer than 100 characters (found 102).
src/com/codefortomorrow/beginner/chapter2/solutions/VariableTypes.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter2/solutions/VariableTypes.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/solutions/VariableTypes.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/solutions/ApplesOranges.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter2/solutions/ApplesOranges.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/solutions/ApplesOranges.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/practice/VariableTypes.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter2/practice/VariableTypes.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/practice/VariableTypes.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/practice/ApplesOranges.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter2/practice/ApplesOranges.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/practice/ApplesOranges.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|20| Line is longer than 100 characters (found 103).
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|23| Line is longer than 100 characters (found 117).
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|17| Line is longer than 100 characters (found 103).
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|19| Line is longer than 100 characters (found 117).
|
||
System.out.println("Welcome to Account Creation!"); | ||
while (true) { | ||
System.out.print("Enter username (4 to 10 characters): "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
System.out.println("Welcome to Account Creation!"); | ||
while (true) { | ||
System.out.print("Enter username (4 to 10 characters): "); | ||
String username = sc.next(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
while (true) { | ||
System.out.print("Enter username (4 to 10 characters): "); | ||
String username = sc.next(); | ||
System.out.print("Enter age: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
System.out.print("Enter username (4 to 10 characters): "); | ||
String username = sc.next(); | ||
System.out.print("Enter age: "); | ||
int age = sc.nextInt(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
String username = sc.next(); | ||
System.out.print("Enter age: "); | ||
int age = sc.nextInt(); | ||
System.out.print("Enter password (4 to 10 characters): "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
} | ||
|
||
public static void createAccount(String username, int age, String password, String confirmPassword) | ||
throws InvalidAgeException, InvalidPasswordException, InvalidUsernameException, PasswordMismatchException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'throws' has incorrect indentation level 6, expected level should be 8.
if (!password.equals(confirmPassword)) { | ||
throw new PasswordMismatchException(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'method def rcurly' has incorrect indentation level 6, expected level should be 4.
} | ||
} | ||
|
||
class InvalidUsernameException extends Exception {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
Top-level class InvalidUsernameException has to reside in its own source file.
|
||
class InvalidUsernameException extends Exception {} | ||
|
||
class InvalidPasswordException extends Exception {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
Top-level class InvalidPasswordException has to reside in its own source file.
|
||
class InvalidPasswordException extends Exception {} | ||
|
||
class InvalidAgeException extends Exception {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
Top-level class InvalidAgeException has to reside in its own source file.
Identation fix again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reviewdog
src/com/codefortomorrow/advanced/chapter14/solutions/Account.java|108 col 1| Top-level class PasswordMismatchException has to reside in its own source file.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|8| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/HelloWorld.java|9| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|8| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|9| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|10| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/solutions/Comments.java|34 col 9| Javadoc comment is placed in the wrong location.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|8| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/HelloWorld.java|9| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|8| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|9| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|10| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter1/practice/Comments.java|30| Line is longer than 100 characters (found 102).
src/com/codefortomorrow/beginner/chapter2/solutions/VariableTypes.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter2/solutions/VariableTypes.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/solutions/VariableTypes.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/solutions/ApplesOranges.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter2/solutions/ApplesOranges.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/solutions/ApplesOranges.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/practice/VariableTypes.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter2/practice/VariableTypes.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/practice/VariableTypes.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/practice/ApplesOranges.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter2/practice/ApplesOranges.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter2/practice/ApplesOranges.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|20| Line is longer than 100 characters (found 103).
src/com/codefortomorrow/beginner/chapter4/solutions/CarDealership.java|23| Line is longer than 100 characters (found 117).
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|3| Summary javadoc is missing.
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|5| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|7| Line continuation have incorrect indentation level, expected level should be 4.
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|17| Line is longer than 100 characters (found 103).
src/com/codefortomorrow/beginner/chapter4/practice/CarDealership.java|19| Line is longer than 100 characters (found 117).
|
||
System.out.println("Welcome to Account Creation!"); | ||
while (true) { | ||
System.out.print("Enter username (4 to 10 characters): "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
System.out.println("Welcome to Account Creation!"); | ||
while (true) { | ||
System.out.print("Enter username (4 to 10 characters): "); | ||
String username = sc.next(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
while (true) { | ||
System.out.print("Enter username (4 to 10 characters): "); | ||
String username = sc.next(); | ||
System.out.print("Enter age: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
System.out.print("Enter username (4 to 10 characters): "); | ||
String username = sc.next(); | ||
System.out.print("Enter age: "); | ||
int age = sc.nextInt(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
String username = sc.next(); | ||
System.out.print("Enter age: "); | ||
int age = sc.nextInt(); | ||
System.out.print("Enter password (4 to 10 characters): "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'while' child has incorrect indentation level 10, expected level should be 12.
} | ||
|
||
public static void createAccount(String username, int age, String password, String confirmPassword) | ||
throws InvalidAgeException, InvalidPasswordException, InvalidUsernameException, PasswordMismatchException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'throws' has incorrect indentation level 6, expected level should be 8.
if (!password.equals(confirmPassword)) { | ||
throw new PasswordMismatchException(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
'method def rcurly' has incorrect indentation level 6, expected level should be 4.
} | ||
} | ||
|
||
class InvalidUsernameException extends Exception {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
Top-level class InvalidUsernameException has to reside in its own source file.
|
||
class InvalidUsernameException extends Exception {} | ||
|
||
class InvalidPasswordException extends Exception {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
Top-level class InvalidPasswordException has to reside in its own source file.
|
||
class InvalidPasswordException extends Exception {} | ||
|
||
class InvalidAgeException extends Exception {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[reviewdog] reported by reviewdog 🐶
Top-level class InvalidAgeException has to reside in its own source file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realized the bot has its own ideas regarding indentation as it seems to keep changing something I did back LOL. I was trying to fix Lines 53-57 on Account.java in the solutions folder. But If that's how it wants then all good looks fine otherwise to me.
Fixed the indentation with the right level
Changes
Also implements changes in #24 due to a git mess up (I accidentally branched from
selection-sort-solution
).