Skip to content

marchesir/stock-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

  1. For a given stock:
    a. Given any price as input, calculate the dividend yield;
    b. Given any price as input, calculate the P/E Ratio;
    c. Record a trade, with timestamp, quantity of shares, buy or sell indicator and traded price;
    d. Calculate Volume Weighted Stock Price based on trades in past 15 minutes;
  2. Calculate the GBCE All Share Index using the geometric mean of prices for all stocks;

Compile and Run

g++ -std=c++0x -o stockcalculator stock.cpp trade.cpp application.cpp stockcalculator.cpp
Make sure test_stockcalcultor does not exist.

Tests

To compile and run test program which follows basic TDD (Test Driven Design):
g++ -std=c++0x -o test_stockcalculator stock.cpp trade.cpp test_stockcalculator.cpp
Make sure stockcalcultor does not exist.

Design

The design is simple and modular, with clean seperation of the various program actors as such:
The above architecture diagram shows a simple overview of the program.

About

Simple stock calculator.

Resources

License

Stars

Watchers

Forks

Languages