Skip to content

CodingNORVINS/CompoundInterest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compound Interest Calculator 💰

A simple Java mini-project for practicing user input, math operations, and console formatting.

Features

  • Input principal amount, annual interest rate, compounding frequency, and years
  • Calculate final amount and total interest earned
  • Formatted output with two decimal places
  • Colorful thank-you message with ASCII art
  • Runs in IntelliJ or terminal

How to Run

  1. Clone or download the repo
  2. Open in IntelliJ IDEA
  3. Run Main.java
  4. Enter the required values when prompted
  5. See your results and thank-you message

Sample Inputs & Outputs

Example 1

Enter the principal amount: 1000  
Enter the annual interest rate (in %): 5  
Enter the number of times interest is compounded per year: 4  
Enter the number of years: 10  

Output:

Final amount after 10 years: $1647.01  
Total interest earned: $647.01  

Thank you for using our calculator!  
Made by CodingNORVIN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@%..*@@@@@@+.#@@@@#=:....:=%@@@@#..:::::-*@@+.=@@@@@@@@=.#@@-.%@@@:.+@@@@@@#.=@@@@@@@@@@@@
@@@@@@@@@@%   =@@@@@+ *@@@- :*%%%%+. =@@@* -@@%%#- -@@. *@@@@@@* :@@@. #@@@   -@@@@@# -@@@@@@@@@@@@
@@@@@@@@@@% -= -@@@@+ *@@: +@@@+#@@@- -@@* -@@@@@@  %@# .@@@@@@. %@@@. #@@@ :+ :%@@@# =@@@@@@@@@@@@
@@@@@@@@@@% -@+ .%@@+ *@* :@@%* :#@@@. %@* -@@@@%- -@@@= -@@@@- *@@@@. #@@@ :@* .#@@# =@@@@@@@@@@@@
@@@@@@@@@@% -@@#  *@+ *@+ -@*=   .=#@: #@*  ::...-*@@@@@: *@@* -@@@@@. #@@@ :@@#. *@# =@@@@@@@@@@@@
@@@@@@@@@@% -@@@%. *+ *@# .@@@%.=@@@%  %@* -%%* .%@@@@@@% .@@..%@@@@@. #@@@ :@@@%: =# =@@@@@@@@@@@@
@@@@@@@@@@% -@@@@@- . *@@= :%@@#@@@#. *@@* -@@@#  #@@@@@@+ -- *@@@@@@. #@@@ :@@@@@= . =@@@@@@@@@@@@
@@@@@@@@@@% -@@@@@@=  *@@@*. -+**+: :#@@@* -@@@@#. *@@@@@@:  -@@@@@@@. #@@@ .@@@@@@+  -@@@@@@@@@@@@
@@@@@@@@@@%=*@@@@@@@*=#@@@@@#=----+#@@@@@%=*@@@@@%==@@@@@@%==@@@@@@@@+=%@@@=+@@@@@@@#=*@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Example 2

Enter the principal amount: 500  
Enter the annual interest rate (in %): 3  
Enter the number of times interest is compounded per year: 12  
Enter the number of years: 5  

Output:

Final amount after 5 years: $580.81  
Total interest earned: $80.81  

Thank you for using our calculator!  
Made by CodingNORVIN

Visual Features

  • Currency: USD ($) by default
  • Formatted numbers with two decimal places
  • Colors: ANSI escape codes for styled console output
  • ASCII Art: Included in thank-you message

License

MIT © CodingNORVIN

About

Simple Java compound interest calculator.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages