How to compute financial ratio in C++ with using header file?
Calculate in c++ program with 3 different file. - 2 file (cpp file) - 1 file (header file)
Information:
formula:-
*1.*Current ratio = (current asset / current liabilities)
*2.*Gross margin = (Revenue – Cost of goods sold) / Revenue
*3.*Operating margin= (Operating Income / Revenue)
*4.*Profit margin = (Net Profit / Revenue)
*5.*ROE= (Net Income/Shareholder's Equity)
I want put 5 formula to run the program. How to put 5 formula in the program but run one formula.
EXAMPLE: In the coding, write all financial ratio. When we compile, just asking 1 formula value only. We need to fixed, which formula to run. Just adjust the coding only. HOW?? pls help.
Please correct me If I'm wrong. I just start study C++ program.
#include <iostream>
#include "functions.h"
int main ()
{
finance_state MyState( 500.0 , 300.0 );
std::cout<< "my current ration is :\t"<< MyState.CurrentRatio()<<std::endl;
return 0;
}
you can extend on this base to implement the remaining functionality.
PS : this code is written on the fly, i didn't try it yet.
if you find any errors, please report them to me.
Above shows only one formula. How to add 4 formula. Just now, I try to do but it show error in the program. Can you help me? Which one has to adjust? I has put 5 formula in this program then I adjust the code to run but it shows the error. I try to adjust few coding many time but can not run. :(
i suggest you refer to the book you're reading and see what it says about classes.
if you don't have a book, you can check the documentation on this site:
OK... I will read and understand the resources that you provided. I will try my level best to do myself. If I can not run the program, I will inform you.
I will post the code also and you try to help, which line is wrong then you help me. Give me some time to do.
Thank you for supporting me and thanks for your resources. Will contact with you soon. :)