Project

fifo_lifo

0.0
No commit activity in last 3 years
No release in over 3 years
You will pass it the two arrays, the goods array and the prices array, the purchases should have positive sign and sells should be negatives
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Fifo and lifo

For a quick demo link

Click this link to see this program running on replit: fifo_lifo on replit, you will need to click on run button

How to run it?

  1. Run this command git clone https://github.com/descholar-ceo/fifo-lifo.git && cd fifo-lifo to clone and go in this repo

  2. Run ruby bin/main.rb

It will display the result based on the following inputs:

purchases_and_sells = [4, -2, -1, 5, -0.5, -0.5, -4.5] # Positive indicate purchase, negative indicate sells
prices = [5000, 6500, 7000, 6000, 8000, 9000, 6500] # Each price is for a purchase or sells of the same index from purchases_and_sells array