{"id":19131156,"url":"https://github.com/pjsalter/triangular-area-rivalry","last_synced_at":"2025-11-13T00:02:00.174Z","repository":{"id":203381395,"uuid":"709454546","full_name":"PJSalter/Triangular-Area-Rivalry","owner":"PJSalter","description":"Triangular Area Rivalry project for comparing the areas of two triangles using the Triangle class","archived":false,"fork":false,"pushed_at":"2023-10-24T19:14:23.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T11:22:02.325Z","etag":null,"topics":["classes-and-objects","cpp","cpp20","object-oriented-programming"],"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/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-24T18:50:37.000Z","updated_at":"2023-10-24T19:16:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff09e51e-e4ce-4f85-8bfd-85150f59949b","html_url":"https://github.com/PJSalter/Triangular-Area-Rivalry","commit_stats":null,"previous_names":["pjsalter/triangular-area-rivalry"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FTriangular-Area-Rivalry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FTriangular-Area-Rivalry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FTriangular-Area-Rivalry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FTriangular-Area-Rivalry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PJSalter","download_url":"https://codeload.github.com/PJSalter/Triangular-Area-Rivalry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240206995,"owners_count":19765041,"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":["classes-and-objects","cpp","cpp20","object-oriented-programming"],"created_at":"2024-11-09T06:14:21.800Z","updated_at":"2025-11-13T00:02:00.085Z","avatar_url":"https://github.com/PJSalter.png","language":"C++","readme":"# Triangular Area Rivalry\n\n## 1. Introduction\n\n\"Triangular Area Rivalry\" is a C++ project that allows you to compare the areas of two triangles. It's implemented using the Triangle class, which provides methods to set the base and height of a triangle, calculate its area, and print its information.\n\n## 2. Usage\n\nTo use the \"Triangular Area Rivalry\" project, follow these steps:\n\n1. Compile the project with a C++ compiler (e.g., g++).\n\n```\ng++ main.cpp Triangle.cpp -o triangular-area-rivalry\n\n```\n\n2. Run the executable:\n\n```\n./triangular-area-rivalry\n```\n\n3. Input the base and height values for two triangles when prompted.\n\n4. The program will determine which triangle has a larger area and display the results.\n\n## 3. Classes\n\n#### Triangle\n\nThe Triangle class represents a triangle. It provides the following methods:\n\n- `void SetBase(double userBase)`: Set the base of the triangle.\n- `void SetHeight(double userHeight)`: Set the height of the triangle.\n- `double GetArea() const`: Calculate and return the area of the triangle.\n- `void PrintInfo() const`: Print the base, height, and area of the triangle.\n\n## 4. Example\n\nHere is an example of how to use the \"Triangular Area Rivalry\" project:\n\n```cpp\n#include \u003ciostream\u003e\n#include \"Triangle.h\"\nusing namespace std;\n\nint main(int argc, const char* argv[]) {\n   Triangle triangle1;\n   Triangle triangle2;\n\n   double base1, height1, base2, height2;\n\n   // Read and set base and height for triangle1\n   cin \u003e\u003e base1 \u003e\u003e height1;\n   triangle1.SetBase(base1);\n   triangle1.SetHeight(height1);\n\n   // Read and set base and height for triangle2\n   cin \u003e\u003e base2 \u003e\u003e height2;\n   triangle2.SetBase(base2);\n   triangle2.SetHeight(height2);\n\n   // Determine which triangle has a larger area\n   double area1 = triangle1.GetArea();\n   double area2 = triangle2.GetArea();\n\n   cout \u003c\u003c \"Triangle with larger area:\" \u003c\u003c endl;\n\n   if (area1 \u003e area2) {\n      triangle1.PrintInfo();\n   } else {\n      triangle2.PrintInfo();\n   }\n\n   return 0;\n}\n\n```\n\n✨ Authored by: [Peter Salter](https://github.com/PJSalter) 🤩\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjsalter%2Ftriangular-area-rivalry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjsalter%2Ftriangular-area-rivalry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjsalter%2Ftriangular-area-rivalry/lists"}