{"id":15683480,"url":"https://github.com/phanxuanquang/object-oriented-programming-uit","last_synced_at":"2025-05-07T02:01:37.847Z","repository":{"id":65361411,"uuid":"435517816","full_name":"phanxuanquang/Object-Oriented-Programming-UIT","owner":"phanxuanquang","description":"Tất cả bài thực hành môn Lập trình hướng đối tượng - Trường Đại học Công nghệ Thông tin","archived":false,"fork":false,"pushed_at":"2024-05-28T16:01:10.000Z","size":1322,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T05:11:15.034Z","etag":null,"topics":["cpp","oop","uit","vietnam","vnu"],"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/phanxuanquang.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":"2021-12-06T13:59:34.000Z","updated_at":"2025-03-27T14:38:17.000Z","dependencies_parsed_at":"2024-05-28T18:26:19.467Z","dependency_job_id":"fe9cf1f7-1ac9-4480-b3d6-4e505b0535d1","html_url":"https://github.com/phanxuanquang/Object-Oriented-Programming-UIT","commit_stats":{"total_commits":68,"total_committers":1,"mean_commits":68.0,"dds":0.0,"last_synced_commit":"0fe34e757fe365b7acbff8401a3ebd92951fede0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanxuanquang%2FObject-Oriented-Programming-UIT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanxuanquang%2FObject-Oriented-Programming-UIT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanxuanquang%2FObject-Oriented-Programming-UIT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanxuanquang%2FObject-Oriented-Programming-UIT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phanxuanquang","download_url":"https://codeload.github.com/phanxuanquang/Object-Oriented-Programming-UIT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252798832,"owners_count":21805882,"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":["cpp","oop","uit","vietnam","vnu"],"created_at":"2024-10-03T17:06:04.746Z","updated_at":"2025-05-07T02:01:37.782Z","avatar_url":"https://github.com/phanxuanquang.png","language":"C++","readme":"# Lập trình hướng đối tượng UIT - Tất cả bài thực hành\nTất cả bài thực hành môn lập trình hướng đối tượng - Trường Đại học Công nghệ Thông tin\n____________________________\nBài làm chỉ mang tính chất tham khảo cho các bạn sinh viên khác. Ngoài ra, đây là môn học tiên quyết cho sự nghiệp phát triển phần mềm, do đó bắt buộc phải hiểu thật sâu và chắc hầu hết các tính chất lẫn khái niệm xuất hiện trong quá trình học môn này.\n____________________________\nĐể học tốt môn này, tác giả khuyên các bạn cần chuẩn bị trước:\n- Hiểu rõ cách triển khai một chương trình tổng quát đầy đủ các thành phần bằng ngôn ngữ C++.\n- Nắm vững kiến thức về những kiểu dữ liệu cơ sở, mảng một chiều và kiến thức căn bản về con trỏ.\n- Có thể định nghĩa kiểu dữ liệu mới bằng kiểu cấu trúc (struct).\n____________________________\n## Một số lưu ý về việc đặt tên cần nhớ:\n\n- Hạn chế đặt tên theo ngôn ngữ sở tại (chẳng hạn như tiếng Việt), nên sử dụng tiếng Anh để tránh người khác đọc hiểu sai nghĩa. Ngoài ra, hãy đặt tên có nghĩa, không nên quá dài và tránh sử dụng những từ dễ bị nhầm lẫn hoặc đồng âm. Lưu ý rằng, viết tắt tên chính là một nghệ thuật và phải thực hiện đúng cách để tối ưu cho việc đọc hiểu.\nVí dụ: \n```console\nstring phoneNumber;\nstring phoneNum;\nint naturalNumber;\n```\n\n- Tên biến và tên hàm nên viết theo dạng lạc đà (CamelCase) hoặc dạng rắn (snake_case). Ở đây, tác giả sử dụng dạng lạc đà. Ví dụ:\n```console\nstring phoneNumber; \nstring phoneNum;\nint arraySize;\n```\n- Tên mảng được đặt theo tên phần tử của mảng ở dạng số nhiều. Quy tắt này được áp dụng trong lập trình hướng đối tượng hoặc với kiểu lập trình sử dụng struct.\nVí dụ: \n```js\nStudent students[100];\nDog asianDogs[100];\n```\n\n- Viết hoa chữ cái đầu mỗi từ trong tên class và struct.\nVí dụ:\n```js\nclass Student {};\nstruct Dog {};\nclass AsianMan {};\n```\n\n- Đối với biến và hàm của kiều dữ liệu bool, hãy đặt tên để ngầm hiểu câu trả lời là Yes hoặc No.\nVí dụ:\n```js\nbool isVerified;\nbool didHomework;\nbool hasFiveDogs;\nbool isValidAccount();\n```\n\n- Viết hoa tất cả các ký tự trong tên của hằng số và mỗi từ trong tên phân tách bởi dấu gạch chân.\nVí dụ: \n```js\nconst double PI = 3.14;\nconst int MAX_SIZE = 10000;\n```\n\n## Ngoài ra:\n- Mỗi hàm chỉ thực hiện duy nhất một chức năng. Tuyệt đối không gộp chức năng tính toán logic và nhập/xuất vào một chung một hàm.\n\n- Hàm main() chỉ được dùng để gọi hàm khác, khai báo những biến được nêu trong yêu cầu và gọi lệnh nhập/xuất cơ bản. Ngoài ra, tuyệt đối không thực hiện thêm chức năng nào khác.\n____________________________\n### Để tối ưu cho việc triển khai chương trình đa lựa chọn dạng menu, tác giả cung cấp cho các bạn một mẫu menu bên dưới.\n\n```js\n#include \u003ciostream\u003e\nusing namespace std;\n\nclass YourClass {\n\tint yourVariable;\n\npublic:\n\tvoid input();\n};\n\nvoid showMenu();\nvoid handleChoiceFor(YourClass\u0026 yourObject);\n\nint main() {\n\tYourClass yourObject;\n\tyourObject.input();\n\n\thandleChoiceFor(yourObject);\n}\n\nvoid YourClass::input() {\n\tcout \u003c\u003c \"Value of your variable is \";\n\tcin \u003e\u003e yourVariable;\n}\n\nvoid showMenu() {\n\tcout \u003c\u003c \"-----------------------------\" \u003c\u003c endl;\n\tcout \u003c\u003c \" (0) Exit.\" \u003c\u003c endl;\n\tcout \u003c\u003c \" (1) Do something usefull.\" \u003c\u003c endl;\n\tcout \u003c\u003c \" (2) Do something usefull.\" \u003c\u003c endl;\n\tcout \u003c\u003c \" (3) Do something usefull.\" \u003c\u003c endl;\n\tcout \u003c\u003c \"-----------------------------\" \u003c\u003c endl;\n}\nvoid handleChoiceFor(YourClass\u0026 yourObject) {\n\tshowMenu();\n\n\tint choice;\n\tcout \u003c\u003c \"Your choice: \";\n\tcin \u003e\u003e choice;\n\tsystem(\"cls\");\n\n\tswitch (choice)\n\t{\n\tcase 0:\n\t\treturn;\n\tcase 1:\n\t\t// Call the function for selection (1) only\n\t\tbreak;\n\tcase 2:\n\t\t// Call the function for selection (2) only\n\t\tbreak;\n\tcase 3:\n\t\t// Call the function for selection (3) only\n\t\tbreak;\n\tdefault:\n\t\tcout \u003c\u003c \"Invalid choice. Please try again!\" \u003c\u003c endl;\n\t\tbreak;\n\t}\n\n\thandleChoiceFor(yourObject);\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphanxuanquang%2Fobject-oriented-programming-uit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphanxuanquang%2Fobject-oriented-programming-uit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphanxuanquang%2Fobject-oriented-programming-uit/lists"}