Skip to content

Instantly share code, notes, and snippets.

View dibakarsutradhar's full-sized avatar
👾
Powered by Coffee

Dibakar dibakarsutradhar

👾
Powered by Coffee
View GitHub Profile
@dibakarsutradhar
dibakarsutradhar / TCS3024-Assignment.cpp
Created May 5, 2019 05:06
Assignment for TCS3024 Introductory Programming
// Dibakar Sutra Dhar
// SUKD1802273
/* Victor and Francis are looking to buy a house in a new development.
After looking at the several of models, the three models they like are colonial, split-entry, and single-story.
The builder gave them the base price and the finished area in square feet of the three models.
They want to know the model(s) with the least price per square foot.
Problem Analysis
Algorithm
@dibakarsutradhar
dibakarsutradhar / realEstate.sol
Created December 8, 2018 08:07
Real Estate Solidity Contract
pragma solidity ^0.5.1;
contract RealEstate {
address payable public seller;
address public buyer;
string public streetAddress;
string title;
uint256 public price;
constructor () public {
#include <iostream>
// global variables
int global = 10;
// main function
int main() {
// local variables with same name
int global = 5;
#include <iostream>
// global variables
int global = 10;
// main function
int main() {
// local variables with same name
int global = 5;
#include <iostream>
// global variables
int global = 10;
void globalDisplay() {
// global variable accessed from within a function
std::cout << global << std::endl;
#include <iostream>
void vars() {
// this is a local variable
int x = 10;
std::cout << x;
}
int main() {
#include <iostream>
void vars() {
// this is a local variable
int x = 10;
}
int main() {
std::cout << "x is: " << x << std::endl;
#include <iostream>
using namespace std;
class abstraction {
private:
int a, b;
public:
void set(int x, int y) {
class Employee {
public:
virtual void raiseSalary() {
// some codes goes here
}
virtual void promote() {
// some codes goes here
}
};
// Example program
#include <iostream>
using namespace std;
class Base {
public:
virtual void show() {
cout << "Base Class" << endl;
}