This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.1; | |
contract RealEstate { | |
address payable public seller; | |
address public buyer; | |
string public streetAddress; | |
string title; | |
uint256 public price; | |
constructor () public { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// global variables | |
int global = 10; | |
// main function | |
int main() { | |
// local variables with same name | |
int global = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// global variables | |
int global = 10; | |
// main function | |
int main() { | |
// local variables with same name | |
int global = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// global variables | |
int global = 10; | |
void globalDisplay() { | |
// global variable accessed from within a function | |
std::cout << global << std::endl; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
void vars() { | |
// this is a local variable | |
int x = 10; | |
std::cout << x; | |
} | |
int main() { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
void vars() { | |
// this is a local variable | |
int x = 10; | |
} | |
int main() { | |
std::cout << "x is: " << x << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class abstraction { | |
private: | |
int a, b; | |
public: | |
void set(int x, int y) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Employee { | |
public: | |
virtual void raiseSalary() { | |
// some codes goes here | |
} | |
virtual void promote() { | |
// some codes goes here | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example program | |
#include <iostream> | |
using namespace std; | |
class Base { | |
public: | |
virtual void show() { | |
cout << "Base Class" << endl; | |
} |
NewerOlder