File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1
- # coding-project-template
1
+ # Introduction to Git and GitHub
2
+
3
+ ## Simple Interest Calculator
4
+
5
+ A calculator that calculates simple interest given principal, annual rate of interest and time period in years.
6
+
7
+ ```
8
+ Input:
9
+ p, principal amount
10
+ t, time period in years
11
+ r, annual rate of interest
12
+ Output
13
+ simple interest = p*t*r
14
+ ```
15
+
16
+ _ © 2022 XYZ, Inc._
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments