This file contains hidden or 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> | |
| #include <string> | |
| using namespace std; | |
| struct node { | |
| node *nextNode; | |
| string value; | |
| }; |
This file contains hidden or 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
| import numpy as npy | |
| import matplotlib.pyplot as mplt | |
| from pandas_datareader import data as pdr | |
| # Gather a portfolio of 5 stocks | |
| # - Amazon: AMZN | |
| # - Microsoft: MSFT | |
| # - Starbucks: SBUX | |
| # - Boeing: BA | |
| # - Costco: COST |
This file contains hidden or 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 <gtest/gtest.h> | |
| #include "../fibonacci.h" | |
| using namespace std; | |
| TEST(TestFibonacci, TestFunctionResults) { | |
| ASSERT_TRUE(fibonacci(1) == 1); | |
| ASSERT_TRUE(fibonacci(10) == 55); | |
| ASSERT_TRUE(fibonacci(16) == 987); |
This file contains hidden or 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
| // fibonacci.h | |
| #ifndef Fibonacci | |
| #define Fibonacci | |
| #include <iostream> | |
| using namespace std; | |
| int fibonacci(int number); | |
| #endif |
This file contains hidden or 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> | |
| #include "fibonacci.h" | |
| using namespace std; | |
| void printValue(int value){ | |
| cout << "Fibonacci number of " << value << " is " << fibonacci(value) << endl; | |
| } | |
| int main(){ |
This file contains hidden or 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 PersonOne { | |
| // This provides PersonTwo access to private/protected attributes | |
| friend class PersonTwo; | |
| private: | |
| int age = 99; | |
| }; |
This file contains hidden or 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> | |
| #include <string> | |
| using namespace std; | |
| class Transportation { | |
| protected: | |
| int topSpeed; | |
| string movementMethod; | |
| string name; |
This file contains hidden or 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> | |
| #include <string> | |
| using namespace std; | |
| class Parent { | |
| private: | |
| string ssn = "123-12-1234"; | |
| protected: | |
| string firstName = "Tom"; |
This file contains hidden or 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 Node: | |
| def __init__(self, value): | |
| self.value = value | |
| self.next = None | |
| def details(self): | |
| print self.value | |
| class LinkedList: | |
| def __init__(self): | |
| self.head = None |
This file contains hidden or 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 Node { | |
| constructor(value) { | |
| this.value = value, | |
| this.next = null | |
| } | |
| details() { | |
| console.log(this.value) | |
| if(this.next && this.next.value){ | |
| console.log("next", this.next.value) | |
| } |
NewerOlder