Informatics - Compiling Program - Compile and Run the Program Using Command Prompt (week 6)

Hello everyone! Finally, after a lot of drama installing the compiler, I can compile and run my program. I compile and run my program by using Command Prompt. In this blog I would like to share to you about how to compile and run the program by using Command Prompt. A Command Prompt is basically a Command Line Interface. It is an application in which the user enters commands, and the operations are executed accordingly. The Command Prompt is an integral part of the Windows Operating System. 

As I stated in the previous blog, the program is in the c++ programming language, and the result is to calculate simple rate interest and compound rate interest.  So here are the steps to compile and run the program in Command Prompt. 

Step 1: Open the file storage and where you save the file. Here, I save my file on the documents. Then double click the folder. 

Step 2: Choose the zip file and then right click the file and press the "Open in Terminal" option. You will straight go to the Command Prompt after clicking the "Open in Terminal" option. 
Step 3: Type "ls" in the command prompt to list the file. Then type "g++ -c ./*cpp" to compile the cpp program. 
Step 4: Then type "ls" again to list the file and type "g++ -o compintcalc.exe ./*o" to open the file in exe format so that it can be run. After that type "ls" again and the result supposed to be like this picture below.
Step 5: Type ".\compintcalc.exe" and there will be information of how you should insert the value. It's supposed to be <interest rate> <present values> <num period>. After that type ".\compintcalc.exe" then put the values next to it to calculate. 
Finally, we can make a simple Interest Rate and Compound Interest Rate calculator to be run. Now, you can try it by yourself on your computer! Let me know your experience by sharing it in the comment section, see y'all at the next post!

Komentar

Postingan populer dari blog ini

Informatics - Making a Main C++ Program to Run all the Calculator Program (week 11)

Informatics - Triangles (week 18)

Informatics - Making Minimarket Discount Program in C++ version 1 (Week 12)