-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Upkar Lidder <[email protected]>
- Loading branch information
Upkar Lidder
committed
Jan 12, 2022
1 parent
ddd1795
commit 8689746
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
# coding-project-template | ||
# Introduction to Git and GitHub | ||
|
||
## Simple Interest Calculator | ||
|
||
A calculator that calculates simple interest given principal, annual rate of interest and time period in years. | ||
|
||
``` | ||
Input: | ||
p, principal amount | ||
t, time period in years | ||
r, annual rate of interest | ||
Output | ||
simple interest = p*t*r | ||
``` | ||
|
||
_© 2022 XYZ, Inc._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/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) | ||
# Addtional 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 |