{"id":19131177,"url":"https://github.com/pjsalter/factorial-calculator","last_synced_at":"2026-06-12T20:32:16.265Z","repository":{"id":200991106,"uuid":"706676060","full_name":"PJSalter/Factorial-Calculator","owner":"PJSalter","description":"Factorial Calculator: A Java program with JUnit 5 tests for calculating factorials of numbers within a specified range.","archived":false,"fork":false,"pushed_at":"2023-10-18T13:10:44.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-12T20:04:30.616Z","etag":null,"topics":["java","java-20","junit5","maven-pom"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PJSalter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-18T12:16:21.000Z","updated_at":"2025-09-06T17:55:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"92de0f14-548e-4ef9-9517-fe153262bf85","html_url":"https://github.com/PJSalter/Factorial-Calculator","commit_stats":null,"previous_names":["pjsalter/factorial-calculator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PJSalter/Factorial-Calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FFactorial-Calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FFactorial-Calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FFactorial-Calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FFactorial-Calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PJSalter","download_url":"https://codeload.github.com/PJSalter/Factorial-Calculator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FFactorial-Calculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34262155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java-20","junit5","maven-pom"],"created_at":"2024-11-09T06:14:23.453Z","updated_at":"2026-06-12T20:32:16.239Z","avatar_url":"https://github.com/PJSalter.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧪 Factorial Calculator 📟\n## Problem Statement\nFor this programming challenge, I was tasked to implement a Java program that calculates and prints the factorial of a number input by the user.\n\nThe factorial of a positive integer num is the product of all numbers in the range from 1 to num.\n\n## Example:\n\n```agsl\nFactorial(4) = 1 * 2 * 3 * 4, which gives the result of 24.\n```\n## Input Format\nThe user can input a value to be used in the calculation.\n\n## Output Format\nThe program will output a single value showing the factorial of the number input by the user.\n\n## Constraints\nThe input value must be:\n\n- An integer\n- Positive\n- Between 1 and 10, inclusive\n\n## Instructions\n- I updated my existing `Factorial.java` class to calculate the proper functionality.\n- For the prompts and other output to the console, I used `this.printStream.print()` and NOT `System.out.println()`.\n\n## Tasks\n1.  Update `isInputNumberValid` Method:\n\n- Update my `isInputNumberValid` method to accept a number from the user and store the value in an instance variable `num`.\n- Use the instance variable `scanner` to accept input from the user.\n- If the input value is valid, return the number input by the user (NOT the factorial of the number).\n- In case of invalid input, print the following message to the console:\n\n```agsl\nInvalid entry. Please enter an integer between 1 and 10, inclusive.\nreturn -1\n```\n\n2. Updating `calculateFactorial` Method:\n\n- Updating my `calculateFactorial` method so that it calculates and outputs the factorial of the number input by the user.\n\n3. Running the Program\n- To run the program, execute the `main` method in the `Factorial.java class`. The program will prompt the user to enter an integer between 1 and 10, inclusive.\n\n## Test Cases\n- 🧪Test cases are implemented using `JUnit 5` to ensure the correctness of my `Factorial class`.\n\n## Created by: 🧑‍🎨[Peter Salter](https://github.com/PJSalter)\n\n## 🚀Happy Coding ✨","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjsalter%2Ffactorial-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjsalter%2Ffactorial-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjsalter%2Ffactorial-calculator/lists"}