Hands-On Portfolio
C++ Projects (Beginner to Advanced)
Menu-Driven Scientific Calculator
BeginnerBuild a CLI calculator supporting arithmetic, powers, square roots, and trigonometry with stream error recovery.
FunctionsSwitch-CasecmathInput Validation
#include <iostream>
#include <cmath>
int main() {
double a = 16, b = 3;
std::cout << "Power: " << std::pow(a, b) << "\nSqrt: " << std::sqrt(a) << "\n";
return 0;
}Sample Output:
Power: 4096 Sqrt: 4
Library Management System (OOP + STL)
IntermediateManage book inventory, issue/return status, and ISBN search using encapsulated classes and STL algorithms.
ClassesEncapsulationstd::vectorstd::find_if
#include <iostream>
#include <vector>
#include <string>
struct Book { int id; std::string title; bool issued = false; };
int main() {
std::vector<Book> lib = {{1, "Effective Modern C++"}, {2, "The C++ Programming Language"}};
lib[0].issued = true;
for (const auto& b : lib) {
std::cout << b.id << ": " << b.title << (b.issued ? " [Issued]" : " [Available]") << "\n";
}
return 0;
}Sample Output:
1: Effective Modern C++ [Issued] 2: The C++ Programming Language [Available]
Thread-Safe In-Memory Key-Value Store
AdvancedImplement a concurrent key-value cache with mutex synchronization and generic value types.
std::unordered_mapstd::mutexstd::lock_guardTemplates
#include <iostream>
#include <unordered_map>
#include <mutex>
#include <string>
template <typename K, typename V>
class ConcurrentStore {
std::unordered_map<K, V> data;
mutable std::mutex mtx;
public:
void put(const K& k, const V& v) {
std::lock_guard<std::mutex> lock(mtx);
data[k] = v;
}
bool get(const K& k, V& out) const {
std::lock_guard<std::mutex> lock(mtx);
auto it = data.find(k);
if (it == data.end()) return false;
out = it->second;
return true;
}
};
int main() {
ConcurrentStore<std::string, int> store;
store.put("cpp20", 2020);
int val = 0;
if (store.get("cpp20", val)) std::cout << "Found: " << val << "\n";
return 0;
}Sample Output:
Found: 2020