Informatics - Run the Cash Flow Calculator Program (week 10)
Hi all! Here I am again making another post for you. As I promised last week on my previous post, I will show you how to run the Cash Flow Calculator program on windows. Are you excited? Let's run the program together! I will show you how to run it step by step.
First step: The first step is open the folder you made for this program on your file explorer. Here, I put my folder on the documents.
Here, I named my file as Cashflow Calculator.Second step: Right click then choose the "open in terminal" option.
After you click the "open in terminal" option you will straight go to the Command Prompt. Third step: Type "g++ -c ./*.cpp" to compile the programs. If it succeeds you will go straight to the next step, then type "ls" to list the files in the folder. But if your program can't be compiled there will be "error" word on the command prompt, and it means that there's something wrong with your program.
As you can see there, we don't have the .exe format file yet. The .exe file format stands for "executable," and its primary function is to launch or execute programs on Windows operating systems. Fourth step: Type "g++ -o CashFlowCalc ./*o" to link object files into a single executable file using the g++ compiler. It links those files together to create a program you can run, mine is called CashFlowCalc.
After that, type ls again to list your files and there you go, we have the .exe format file.
Sixth step: Insert the value to calculate.
Explanation:- Input the discount rate (3%) for the cash flow calculations. Here I put 3% as the discount rate.
- Input the time periods and the cashflow amounts.
1 100: In year 1, there is a cash flow of 100.
2 200: In year 2, there is a cash flow of 200.
3 250: In year 3, there is a cash flow of 250.
4 300: In year 4, there is a cash flow of 300.
- (-1) signaling that you have finished entering cash flow data.
Program outputs:
- Value25 : Possibly the discounted value of the cash flow in year 1.
- Same as Value25, Value12.5, Value 3.90625, and Value1.17188 are discounted cash flow values for subsequent years.
- The program sums up all the discounted cash flows to compute the present value, which is 42.5781.
Alright! That's all for the Cash Flow Calculator program. I hope it can help you to understand how to run the cashflow program. My next blog will be about me making a main cpp program to calculate all of the calculator that I have. So, stay tuned for my next blog! Thank you!.
.png)
.png)
.png)
%20copy.png)
.png)
.png)
Komentar
Posting Komentar