Skip to content

Conversation

phrdang
Copy link
Member

@phrdang phrdang commented Jul 1, 2021

Changes

  • Ch. 14.7 Account practice problem
    • Consolidate into 1 class called Account.java
    • Clarify instructions and post instructions in the file
    • Close Scanner object when done
    • NOTE: I have already updated the instructions on Notion for this problem, but the template and solution code links are wrong
  • Ch. 13.5 Negative Sum practice problem
    • Fix solution package statement

Also implements changes in #24 due to a git mess up (I accidentally branched from selection-sort-solution).

phrdang added 3 commits June 30, 2021 18:13
- Consolidate into 1 class called Account.java
- Clarify instructions and post instructions in the file
- Close Scanner object when done
@phrdang phrdang added bug Something isn't working practice problem labels Jul 1, 2021
@phrdang phrdang requested review from AlveeraMunshi and JJ27 July 1, 2021 18:22
@phrdang phrdang removed the request for review from JJ27 July 1, 2021 20:20
AlveeraMunshi and others added 2 commits July 1, 2021 17:27
Fixed a couple identation things and formatting on the createAccount method where parameters are initialized
Copy link

@github-actions github-actions bot left a 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): ");
Copy link

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();
Copy link

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: ");
Copy link

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();
Copy link

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): ");
Copy link

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 {
Copy link

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();
}
}
Copy link

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 {}
Copy link

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 {}
Copy link

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 {}
Copy link

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.

Copy link

@github-actions github-actions bot left a 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): ");
Copy link

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();
Copy link

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: ");
Copy link

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();
Copy link

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): ");
Copy link

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 {
Copy link

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();
}
}
Copy link

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 {}
Copy link

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 {}
Copy link

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 {}
Copy link

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.

Copy link
Member

@AlveeraMunshi AlveeraMunshi left a 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
@phrdang phrdang merged commit 1bc9537 into master Jul 1, 2021
@phrdang phrdang deleted the fix-account branch July 1, 2021 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working practice problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants