London | 26-Java-Jun | Aida Eslamimoghadam | Sprint 1 | Prep Exercises & Backlog#14
London | 26-Java-Jun | Aida Eslamimoghadam | Sprint 1 | Prep Exercises & Backlog#14aydaeslami wants to merge 9 commits into
Conversation
ClaudiaBedin
left a comment
There was a problem hiding this comment.
Nice work, only added a few minor comments.
| * If i % j == 0, increase the counter. | ||
| * If the counter is 2, the number is prime, so print it. | ||
| */ | ||
|
|
There was a problem hiding this comment.
Javadocs sit on the class or method they are written for, so you can delete the extra empty lines here.
| printPrimeNumbers(1000); | ||
|
|
||
| } | ||
| } |
There was a problem hiding this comment.
Good job, this indeed prints all prime numbers from 1 to 1000, and syntax and indentation are correct.
| @@ -0,0 +1,10 @@ | |||
| package Exe1; | |||
|
|
|||
| public class HelloWorld { | |||
There was a problem hiding this comment.
It's easier for the reviewer to see the exercise instructions on a comment just to have the context without referring to the course curriculum. No need to change these files though, just a note for future reviews :)
| char cChar='A'; | ||
|
|
||
| System.out.println(iNum+" "+dNumber+" "+bValue+" "+cChar ); | ||
|
|
There was a problem hiding this comment.
It looks neater if you remove the extra empty lines (here and on following files).
| } | ||
|
|
||
| } | ||
| } |
| public static void main (String[] args) { | ||
|
|
||
| int iDay = receiveNumber(); | ||
| while (iDay < 1 || iDay > 7) { |
There was a problem hiding this comment.
Why did you choose to name the variable iDay?
| } | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
The validation strategy that you choose to ensure that only numbers 1 to 7 are entered works. An alternative way would be to use the default case on the switch statements. Would you be able to tell me in a comment how that could look like?
| // private: This method can only be accessed inside this class. | ||
| // static: This method belongs to the class, so it can be called without creating an object. | ||
| // String: This is the return type. The method returns a String. | ||
| // greetUser: This is the method name. |
There was a problem hiding this comment.
Technically the method name is called method identifier.
| num2= inputObj.nextInt(); | ||
| System.out.println("The sum is: " + calculateSum(num1,num2)); | ||
|
|
||
| } |
|
|
||
| System.out.println("Reversed number: " + reverseNumber(number)); | ||
|
|
||
|
|
There was a problem hiding this comment.
What would happen if a user enters -547? Do we want this method to work with negative integers, or do we want to explicitly exclude them?
Summary
Completed the Sprint 1 prep exercises and the assigned backlog tasks.
Backlog
Added JavaDoc comments where appropriate and tested the solutions.