Skip to content

Commit

Permalink
Create simple-interest.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alex4cable authored Oct 27, 2024
1 parent 277bd3b commit baa1376
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions simple-interest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# This script calculates simple interest given principal,
# annual rate of interest and time period in years.
# Do not use this in production. Sample purpose only.
# Author: Upkar Lidder (IBM)
# Additional Authors:
# <your GitHub username>
# Input:
# p, principal amount
# t, time period in years
# r, annual rate of interest
# Output:
# simple interest = p*t*r
echo "Enter the principal:"
read p
echo "Enter rate of interest per year:"
read r
echo "Enter time period in years:"
read t
s=`expr $p \* $t \* $r / 100`
echo "The simple interest is: "
echo $s

0 comments on commit baa1376

Please sign in to comment.