{"id":18513583,"url":"https://github.com/marko19907/cpp-exam","last_synced_at":"2025-10-25T22:08:08.150Z","repository":{"id":103773623,"uuid":"585715766","full_name":"Marko19907/CPP-exam","owner":"Marko19907","description":" \"C++ for programmers\" (INFT2503) exam, fall 2022.","archived":false,"fork":false,"pushed_at":"2023-01-05T22:12:03.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T03:30:25.613Z","etag":null,"topics":["cmake","cpp","cpp-templates","cpp14","exam","lambda-functions","object-oriented-programming","operator-overloading","smart-pointers"],"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/Marko19907.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":"2023-01-05T22:11:00.000Z","updated_at":"2023-01-07T15:13:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"a41f90a4-3efb-4e14-8a1e-a4164e16aacc","html_url":"https://github.com/Marko19907/CPP-exam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marko19907%2FCPP-exam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marko19907%2FCPP-exam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marko19907%2FCPP-exam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marko19907%2FCPP-exam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marko19907","download_url":"https://codeload.github.com/Marko19907/CPP-exam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142598,"owners_count":22021565,"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":["cmake","cpp","cpp-templates","cpp14","exam","lambda-functions","object-oriented-programming","operator-overloading","smart-pointers"],"created_at":"2024-11-06T15:39:25.534Z","updated_at":"2025-10-25T22:08:03.121Z","avatar_url":"https://github.com/Marko19907.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ exam\n\nThe fall 2022 exam from the \"C++ for programmers\" (INFT2503) course.\n\nCounts towards 100% of the final grade in the subject.\n\n[![CMake build](https://github.com/Marko19907/CPP-exam/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/Marko19907/CPP-exam/actions/workflows/build.yml)\n\n\n## Tasks\n\n\n### Task 1\n\nCreate the necessary functions so that the following:\n\n```C++\ncout \u003c\u003c concat(\"hello\", \"world\") \u003c\u003c endl;\ncout \u003c\u003c concat(1, 2) \u003c\u003c endl;\ncout \u003c\u003c concat({\"a\", \"b\", \"c\"}) \u003c\u003c endl;\n```\n\nOutputs this:\n\n```\nhelloworld\n12\nabc\n```\n\n\n### Task 2\n\nCreate the necessary classes so that the following:\n\n```C++\nvector\u003cunique_ptr\u003cAnimal\u003e\u003e animals;\nanimals.emplace_back(make_unique\u003cElephant\u003e());\nanimals.emplace_back(make_unique\u003cElephant\u003e());\nanimals.emplace_back(make_unique\u003cPig\u003e());\n\nfor(auto \u0026a : animals)\n  cout \u003c\u003c a-\u003emakeNoise() \u003c\u003c endl;\n```\n\nOutputs this:\n\n```\nToot!\nToot!\nHonk!\n```\n\n\n### Task 3\n\nCreate the necessary functions so that the following:\n\n```C++\ncout \u003c\u003c map_f\u003cint, int\u003e({1, 2, 3}, [](int a){return a * 2;}) \u003c\u003c endl;\ncout \u003c\u003c map_f\u003cfloat, float\u003e({1, 2.3, 3}, [](float a){return a /2;}) \u003c\u003c endl;\ncout \u003c\u003c map_f\u003cstring, string\u003e({\"hello\", \"world\"}, [](string s){return s + \".\";}) \u003c\u003c endl;\ncout \u003c\u003c map_f\u003cstring, int\u003e({\"hello\", \"world\"}, [](string s){return s.size();}) \u003c\u003c endl;\n```\n\nOutputs this:\n\n```\n{ 2, 4, 6 }\n{ 0.5, 1.15, 1.5 }\n{ hello., world. }\n{ 5, 5 }\n```\n\n\n### Task 4\n\nCreate the necessary classes so that the following:\n \n```C++\nMatrix\u003cint\u003e m_a({{1, 2}, {3, 4}, {5, 6}});\nMatrix\u003cint\u003e m_b({{1, 2, 3}, {4, 5, 6}});\n\ncout \u003c\u003c m_a \u003c\u003c endl;\ncout \u003c\u003c m_b \u003c\u003c endl;\ncout \u003c\u003c m_a * m_b \u003c\u003c endl;\ncout \u003c\u003c m_b * m_a \u003c\u003c endl;\n\n\nMatrix\u003cint\u003e m_c({{1, 2}});\nMatrix\u003cint\u003e m_d({{2}, {2}});\n\ncout \u003c\u003c m_c * m_d \u003c\u003c endl;\ncout \u003c\u003c m_d * m_c \u003c\u003c endl;\n```\n\nOutputs this:\n\n```\n[ 1 2 ]\n[ 3 4 ]\n[ 5 6 ]\n\n[ 1 2 3 ]\n[ 4 5 6 ]\n\n[ 9 12 15 ]\n[ 19 26 33 ]\n[ 29 40 51 ]\n\n[ 22 28 ]\n[ 49 64 ]\n\n[ 6 ]\n\n[ 2 4 ]\n[ 2 4 ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarko19907%2Fcpp-exam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarko19907%2Fcpp-exam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarko19907%2Fcpp-exam/lists"}