Giter Site home page Giter Site logo

cppnd-capstone's Introduction

Capstone Description

This project is a capstone for the Udacity C++ Nanodegree. The option chosen was "Capstone Option 1." This project is a stock portfolio simulator that loads stock data and perform two algorithms to compare the portfolio performance after iterating through all the available data. After processing the data, the program reports each portfolio's performance relative to the starting balance.

The porfolios use two algorithms for randomly placing purchase/sell on available stock based on the current balance. PortfolioRandom implements a random purchase/sell algorithm, whereas PortfolioRandom2 performs the same algorithm as well as offloading any stocks which fall below the purchase value.

Rubric Overview

Compiling and Testing

Result Criteria Notes
The submission must compile and run. The project compiles and runs.

Loops, Functions, I/O

Result Criteria Notes
The project demonstrates an understanding of C++ functions and control structures.
The project reads data from a file and process the data, or the program writes data to a file. src/main.cpp:109 Read in CSV file.
The project accepts user input and processes the input. src/main.cpp:89 The user can pass in a command line argument specifying the portfolio's starting balance.

Object Oriented Programming

Result Criteria Notes
The project uses Object Oriented Programming techniques. types/include/Types/Portfolio.hpp
Classes use appropriate access specifiers for class members. types/include/Types/Portfolio.hpp:61
Class constructors utilize member initialization lists. types/include/Types/Portfolio.hpp:42
Classes abstract implementation details from their interfaces.
Classes encapsulate behavior.
Classes follow an appropriate inheritance hierarchy.
Overloaded functions allow the same function to operate on different parameters. types/include/Types/Portfolio.hpp:51
Derived class functions override virtual base class functions. types/include/Types/PortfolioRandom2.hpp:8
Templates generalize functions in the project. utils/include/Utils/Queue.hpp:9

Memory Management

Result Criteria Notes
The project makes use of references in function declarations.
The project uses destructors appropriately.
The project uses scope / Resource Acquisition Is Initialization (RAII) where appropriate.
The project follows the Rule of 5.
The project uses move semantics to move data, instead of copying it, where possible. utils/include/Utils/Queue.hpp:24
The project uses smart pointers instead of raw pointers. src/main.cpp:111

Concurrency

Result Criteria Notes
The project uses multithreading. src/main.cpp:167
🔲 A promise and future is used in the project. ⚠️ This project does not employ promises/futures
A mutex or lock is used in the project. utils/include/Utils/Queue.hpp:16
A condition variable is used in the project. utils/include/Utils/Queue.hpp:19

Build/Run Dependencies

This project depends on CMake, google tests, and spdlog. All dependencies, except for CMake are included in the vendor directory.

Build Project

To compile this project, run the following commands:

mkdir build && cd build 
cmake -DCMAKE_BUILD_TYPE=Release .. 

Run project

From the root of the project, run ./build/bin/stockSim to run the default program with a balance of $ 10,000. To specify a different starting balance, provide the balance as a command line parameter, ./build/bin/stockSim 5000.

cppnd-capstone's People

Contributors

joaobaiense avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.