Skip to content

Commit 8689746

Browse files
author
Upkar Lidder
committed
initial files
Signed-off-by: Upkar Lidder <[email protected]>
1 parent ddd1795 commit 8689746

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
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._

simple-interest.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)