{"id":16104895,"url":"https://github.com/dbc2201/salary-calculator","last_synced_at":"2025-09-07T20:04:32.767Z","repository":{"id":133011917,"uuid":"461867147","full_name":"dbc2201/salary-calculator","owner":"dbc2201","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-21T13:10:25.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T20:04:31.046Z","etag":null,"topics":["exercism-solutions","java"],"latest_commit_sha":null,"homepage":"https://exercism.org/tracks/java/exercises/salary-calculator","language":"HTML","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/dbc2201.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-21T13:10:20.000Z","updated_at":"2022-02-21T13:10:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"c792468a-1c3e-44ac-b4ec-79b846f0d8c4","html_url":"https://github.com/dbc2201/salary-calculator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dbc2201/salary-calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Fsalary-calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Fsalary-calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Fsalary-calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Fsalary-calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbc2201","download_url":"https://codeload.github.com/dbc2201/salary-calculator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Fsalary-calculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274088625,"owners_count":25220260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"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":["exercism-solutions","java"],"created_at":"2024-10-09T19:06:51.715Z","updated_at":"2025-09-07T20:04:32.740Z","avatar_url":"https://github.com/dbc2201.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Salary Calculator\n\nWelcome to Salary Calculator on Exercism's Java Track. If you need help running the tests or submitting your code, check\nout `HELP.md`. If you get stuck on the exercise, check out `HINTS.md`, but try and solve it without using those first :)\n\n## Introduction\n\nThe _ternary operator_ is a lightweight, compact alternative for simple _if/else_ statements. Usually used in (but not\nrestricted to) return statements, it needs just one single line to make the decision, returning the left value if the\nexpression is `true` and the right value if `false`, as follows:\n\n```java\nboolean expr=0!=200;\n\n// Ternary statement\n        int value=expr?22:33;\n// =\u003e 22\n```\n\nA lot of simple _if/else_ expressions can be simplified using _ternary operators_.\n\n## Instructions\n\nIn this exercise, you'll be implementing rules for calculating the total salary of a employee in a month. The\nInternational Siderurgy Company (ISC) needs help to calculate the salary for the employees, given that different factors\ncan alter the final wage value for each employee.\n\nYou have three tasks and you should use the ternary operator instead of if/else statements to implement them.\n\n## 1. Determine the salary multiplier\n\nImplement the `multiplierPerDaysSkipped` method that returns the salary multiplier based on the number of days the\nemployee skipped the job. A 15% penalty is applied if more than five days were skipped.\n\n```java\nint daysSkipped=3;\n        multiplierPerDaysSkipped(daysSkipped);\n// =\u003e 1\n\n        daysSkipped=7;\n        multiplierPerDaysSkipped(daysSkipped);\n// =\u003e 0.85\n```\n\n## 2. Calculate the bonus for products sold\n\nImplement the `multiplierPerProductsSold` and `bonusForProductSold` methods. The ISC pays ten monetary units for each\nproduct sold, but if the employee sold more than twenty products, the multiplier is improved to\nthirteen. `multiplierPerProductsSold` should decide which multiplier is applied and `bonusForProductSold` should return\nthe total bonus in monetary units.\n\n```java\nint productsSold=21;\n        multiplierPerProductsSold(productsSold);\n// =\u003e 13\n\n        productsSold=5;\n        bonusForProductSold(productsSold);\n// =\u003e 50\n```\n\n## 3. Calculate the final salary for the employee\n\nImplement the `finalSalary` method. It should be able to multiply the base salary of 1000.00 by the salary multiplier\nand sum the bonus and return the result, but keep in mind that salaries should be capped at 2000.00;\n\n```java\nint daysSkipped=2;\n        int productsSold=3;\n        finalSalary(daysSkipped,productsSold);\n// =\u003e 1030\n```\n\n## Source\n\n### Created by\n\n- @TalesDias","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbc2201%2Fsalary-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbc2201%2Fsalary-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbc2201%2Fsalary-calculator/lists"}