Skip to content

About

Bash script that calculates simple interest from principal, annual rate, and time in years

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

github-final-project

A Bash script that calculates simple interest from a principal amount, an annual interest rate, and a time period in years.

Features

  • Interactive prompts for principal, annual rate (in percent), and time period in years
  • Computes simple interest as principal × time × rate / 100
  • Single self-contained script with no dependencies beyond a POSIX shell with expr

Run it

bash simple-interest.sh

Example session:

Enter the principal:
1000
Enter rate of interest per year:
5
Enter time period in years:
2
The simple interest is:
100

Notes

  • The script uses expr, which only does integer arithmetic, so enter whole numbers.
  • No input validation is performed.
  • Sample code for learning purposes. Do not use it in production.

Credits

  • Original author: Upkar Lidder (IBM), per the script header
  • Additional author: y0c0ms

Licence

Apache License 2.0. See LICENSE.


© 2023 XYZ, Inc.

About

Bash script that calculates simple interest from principal, annual rate, and time in years

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages