{"id":20313475,"url":"https://github.com/ebkr/unidaystechplacement","last_synced_at":"2026-04-20T04:06:15.446Z","repository":{"id":103686413,"uuid":"158628112","full_name":"ebkr/UnidaysTechPlacement","owner":"ebkr","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-22T02:49:29.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T08:36:22.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ebkr.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":"2018-11-22T01:49:05.000Z","updated_at":"2018-11-22T02:49:30.000Z","dependencies_parsed_at":"2023-07-07T00:45:33.336Z","dependency_job_id":null,"html_url":"https://github.com/ebkr/UnidaysTechPlacement","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ebkr/UnidaysTechPlacement","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkr%2FUnidaysTechPlacement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkr%2FUnidaysTechPlacement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkr%2FUnidaysTechPlacement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkr%2FUnidaysTechPlacement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebkr","download_url":"https://codeload.github.com/ebkr/UnidaysTechPlacement/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebkr%2FUnidaysTechPlacement/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32032306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":[],"created_at":"2024-11-14T18:11:12.025Z","updated_at":"2026-04-20T04:06:15.397Z","avatar_url":"https://github.com/ebkr.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# UnidaysTechPlacement\r\n \r\n \r\n## The repository contains a batch file to compile and run the Main class.\r\n\r\n\r\n### Discounts\r\n\r\n\r\nI approached the solution by working on how I'd enable discounts first.\r\n\r\nIt took several iterations, but I came up with a method that would work perfectly.\r\n\r\nThis method is the PricingRule class, and is initialised by {normalPrice, quantityToApplyDiscount, discountPrice}.\r\n\r\n### Pricing\r\n\r\n\r\nOnce items are added to the basket, they have their price calculated. This works by finding how many of each item there are stored, and applying the discount based on the quantity.\r\n\r\nFor example, 5 items, with a rule of {2, 2, 1} would be:\r\n\r\n2 groups of 2 match required quantity. Therefore, total += 2*discountPrice.\r\n\r\nThere is 1 item remaining, Therefore, total += 1*normalPrice.\r\n\r\n## Total\r\n\r\nI've used a BasketResult class to display the total cost, and the delivery charge.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febkr%2Funidaystechplacement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febkr%2Funidaystechplacement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febkr%2Funidaystechplacement/lists"}