{"id":21280095,"url":"https://github.com/arezyhs/cpp-id-generator-calc","last_synced_at":"2025-03-15T13:46:03.020Z","repository":{"id":225855905,"uuid":"767047241","full_name":"arezyhs/cpp-id-generator-calc","owner":"arezyhs","description":"Generator ID untuk praktikum mata kuliah Struktur Data. ID yang dihasilkan adalah ID supir dan ID pesanan.","archived":false,"fork":false,"pushed_at":"2024-03-18T16:09:11.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T04:10:46.723Z","etag":null,"topics":["cplusplus","data-structures","id-generator"],"latest_commit_sha":null,"homepage":"","language":"C++","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/arezyhs.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":"2024-03-04T15:58:35.000Z","updated_at":"2024-03-17T23:37:33.000Z","dependencies_parsed_at":"2024-11-21T13:02:53.546Z","dependency_job_id":null,"html_url":"https://github.com/arezyhs/cpp-id-generator-calc","commit_stats":null,"previous_names":["arezyhs/cpp-id-generator-calc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arezyhs%2Fcpp-id-generator-calc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arezyhs%2Fcpp-id-generator-calc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arezyhs%2Fcpp-id-generator-calc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arezyhs%2Fcpp-id-generator-calc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arezyhs","download_url":"https://codeload.github.com/arezyhs/cpp-id-generator-calc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243738955,"owners_count":20339997,"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","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":["cplusplus","data-structures","id-generator"],"created_at":"2024-11-21T10:28:02.144Z","updated_at":"2025-03-15T13:46:03.000Z","avatar_url":"https://github.com/arezyhs.png","language":"C++","readme":"# C++ ID Generator for Data Structures Lab\n\n## Overview\n\nThis C++ program serves as an ID generator tailored for Data Structures, implementing specific rules for ID creation. The program consists of two main functions, `buatIDBaru` and `buatIDOrder`, responsible for generating unique driver IDs (`ID SUPIR`) and order IDs (`ID Order`), respectively.\n\n## Features\n\n### ID Rules:\n\n**1. ID GENERATOR FOR DRIVER:**\n   - The ID consists of 5 digits.\n   - The first two digits represent the absolute difference between the first and last letters of the driver's name.\n   - The third digit signifies the gender of the driver (1 for male, 0 for female).\n   - The fourth digit is obtained by summing the last digits of the driver's birthdate (day, month, and year) and taking the modulus of 9.\n   - The fifth digit is initially set to 0. In case of duplicate IDs, this digit is incremented. If it reaches 9, it resets to 0, and an additional digit is added to the ID.\n  \n  ### Example:\n   - Driver: Sugeng Pangestu\n   - Name : Sugeng Pangestu -\u003e S-u = 19-21 = 2\n   - Gender: Male (1)\n   - Birthdate: 21-02-1999 (last digits sum: 1+2+9 = 12, modulus 9 = 3)\n   - Initial fifth digit: 0\n   So, the generated ID SUPIR: 02130\n\n**2. ID GENERATOR FOR DRIVER AND ORDER:**\n   - The ID consists of 10 digits.\n   - The first two digits represent the alphabetical order of the first character on the license plate of the taxi.\n   - Digits 3 to 7 represent the driver's ID. For example, for the driver \"Sugeng Pangestu,\" the first 7 digits would be 1216130.\n   - Digits 8 and 9 are obtained from the order's destination, considering the last 2 characters. For instance, for the destination \"Ketintang,\" the next 2 digits would be 21.\n   - The last digit is derived from the sum of the alphabetical order of all characters in the customer's name, with the last digit taken if the sum is more than one digit.\n\n   ### Example:\n   Driver: Sugeng Pangestu -\u003e 02130\n   - License Plate: L 1996 YZ -\u003e L = 12\n   - Destination: Ketintang -\u003e n + g = 7 + 14 = 21\n   - Customer Name: Komeng -\u003e sum of komeng and take the last digit of that sum = 5\n   So, the generated ID Order is 1202130215\n\n### Known Problem\n\n- The program was initially unable to generate a 6-digit ID. The latest version has fixed this issue by resetting the fifth digit to 0 and adding an additional digit when it reaches 9, ensuring the creation of a 6-digit ID as needed.\n\n## How to Use\n\n1. Modify the test data for the driver (`namaSupir`, `genderSupir`, `tanggalLahirSupir`) and customer (`platNomor`, `tujuan`, `namaPelanggan`) in the `main` function.\n2. Run the program to generate the Driver ID (`ID SUPIR`) and Order ID (`ID Order`).\n3. Review the console output for the generated IDs.\n\n## Requirements\n\n- C++ compiler\n- Standard C++ libraries\n\n## Disclaimer\n\nThis program assumes proper input data adherence to avoid errors and unexpected behavior.\nFeel free to use and modify this program for your educational purposes. If you encounter any issues or have suggestions for improvement, please let us know.\nHappy coding!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farezyhs%2Fcpp-id-generator-calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farezyhs%2Fcpp-id-generator-calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farezyhs%2Fcpp-id-generator-calc/lists"}