Skip to content

London | 26-Java-Jun | Aida Eslamimoghadam | Sprint 1 | Prep Exercises & Backlog#14

Open
aydaeslami wants to merge 9 commits into
CodeYourFuture:mainfrom
aydaeslami:main
Open

London | 26-Java-Jun | Aida Eslamimoghadam | Sprint 1 | Prep Exercises & Backlog#14
aydaeslami wants to merge 9 commits into
CodeYourFuture:mainfrom
aydaeslami:main

Conversation

@aydaeslami

Copy link
Copy Markdown
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Summary

Completed the Sprint 1 prep exercises and the assigned backlog tasks.

Backlog

  • Print prime numbers up to 1000.
  • Reverse the digits of a number.

Added JavaDoc comments where appropriate and tested the solutions.

@aydaeslami aydaeslami added 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jun 28, 2026
@ClaudiaBedin ClaudiaBedin self-requested a review July 5, 2026 14:43

@ClaudiaBedin ClaudiaBedin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadocs sit on the class or method they are written for, so you can delete the extra empty lines here.

printPrimeNumbers(1000);

}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, this indeed prints all prime numbers from 1 to 1000, and syntax and indentation are correct.

Comment thread src/Exe1/HelloWorld.java
@@ -0,0 +1,10 @@
package Exe1;

public class HelloWorld {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks neater if you remove the extra empty lines (here and on following files).

Comment thread src/Exe3/forLoop.java
}

}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Comment thread src/Exe4/SwitchCase.java
public static void main (String[] args) {

int iDay = receiveNumber();
while (iDay < 1 || iDay > 7) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you choose to name the variable iDay?

Comment thread src/Exe4/SwitchCase.java
}
}


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the method name is called method identifier.

num2= inputObj.nextInt();
System.out.println("The sum is: " + calculateSum(num1,num2));

}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one


System.out.println("Reversed number: " + reverseNumber(number));


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants