We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4e5aa3 commit 2a3b643Copy full SHA for 2a3b643
simple-interest.sh
@@ -0,0 +1,26 @@
1
+#!/bin/bash
2
+# This script calculates simple interest given principal, annual rate of interest and time period in years.
3
+# Do not use this in production. Sample purpose only.
4
+
5
+# Author: Upkar Lidder (IBM)
6
+# Addtional Authors:
7
+# <your Github username>
8
9
+# Input:
10
+# p, principal amount
11
+# t, time period in years
12
+# r, annual rate of interest
13
14
+# Output:
15
+# simple interest = p*t*r
16
17
+echo "Enter the principal:"
18
+read p
19
+echo "Enter rate of interest per year:"
20
+read r
21
+echo "Enter time period in years:"
22
+read t
23
24
+s=$(expr $p \* $t \* $r / 100)
25
+echo "The simple interest is: "
26
+echo $s
0 commit comments