A

@abhaumik

calculate area of rect, square and triangle using SOLID principles

C++
8 months ago
// Online C++ compiler to run C++ program online #include <iostream> using namespace std; class shape { public: int area; virtual void calculatearea() = 0; virtual void printarea() = 0;

Composite Design Pattern ( File System)

C++
10 months ago
#include <iostream> #include<vector> using namespace std; class FileSystem { public: virtual void ls()=0; virtual void openall()=0; virtual int getsize()=0;

winwire questions

C++
11 months ago
#include <iostream> using namespace std; // Coding Questions // Q- // / Find the output/Error in below code snippned class Base {

even odd without condition variable

C++
1 year ago
#include <iostream> #include <thread> #include <mutex> int counter = 1; const int MAX = 10; std::mutex mtx; bool turn_even = false; // false -> odd's turn, true -> even's turn void print_even() {

print 1 2 3 one by one using 3 threads

C++
1 year ago
#include <iostream> #include <thread> #include <mutex> #include <condition_variable> using namespace std; const int N = 15; // Change N to print up to any number int current = 1; // Shared variable to track the number to print mutex mtx; /

wite own move constructor for this class

C++
1 year ago
#include <iostream> #include <cstring> using namespace std; class Student { string name; int marks[10]; char * dep[5]; int total_markes;

Reader writer prob

C++
1 year ago
#include <iostream> #include <thread> #include <shared_mutex> //#include <unique_lock> using namespace std; int sharedresource=0; shared_mutex shmtx; void reader(int id) {

thread testing

C++
1 year ago
#include <iostream> #include <thread> #include <string> #include <mutex> using namespace std; mutex m1; int var=1; void function(int id)

Substring of a string

C++
1 year ago
#include <iostream> using namespace std; // programming // gram // 3

lhtlhlt

C++
1 year ago
#include <iostream> #include <vector> using namespace std; //3 void shiftzeroinend(vector<int> &arr) { int n = arr.size(); int start =0;

Playing around virtual functions

C++
1 year ago
#include <iostream> using namespace std; class Base { public: Base() { cout<<"Constructor BAse is called"<<endl;

even odd print simuntaneously

C++
1 year ago
#include <iostream> #include <thread> #include <condition_variable> #include <mutex> using namespace std; mutex mtx; condition_variable cv; #define MAX_NUM 10 int x=1;

Min heap implementation(Min Number Game)

C++
1 year ago
#include <iostream> using namespace std; class minheap { vector<int> heap; public: minheap() { heap.push_back(-1);

My string implementation

C++
1 year ago
#include <iostream> #include<string.h> using namespace std; class mystring { char *str; int len; public:

My Vector class implementation

C++
1 year ago
#include <iostream> using namespace std; template<typename T> class myvector{ T *arr; int capacity; int current; public:

Decorator Design pattern

C++
1 year ago
#include <iostream> using namespace std; class FoodItem { public: int price; string description; virtual string getdescription()=0; virtual int getprice()=0;

Adapter Design Pattern

C++
1 year ago
#include <iostream> using namespace std; //Adaptee class Analytictool { public: string jsondata; virtual void setdata(string pjsondata)=0;

Template Design pattern

C++
1 year ago
#include <iostream> using namespace std; class Delivery { public: void processorder() { takeorder();

strategy design pattern

C++
1 year ago
#include <iostream> using namespace std; class Payementstrategy { public: virtual void execute(int amount) = 0; virtual ~Payementstrategy() {

command design pattern

C++
1 year ago
#include <iostream> using namespace std; class Receiver { public: void open() {