From 8689746b21d169535a653e623322ee3d3b172b7f Mon Sep 17 00:00:00 2001 From: Upkar Lidder Date: Wed, 12 Jan 2022 13:55:46 -0800 Subject: [PATCH] initial files Signed-off-by: Upkar Lidder --- README.md | 17 ++++++++++++++++- simple-interest.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 simple-interest.sh diff --git a/README.md b/README.md index 5884e26a5b..b103466139 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -# coding-project-template \ No newline at end of file +# 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._ diff --git a/simple-interest.sh b/simple-interest.sh new file mode 100755 index 0000000000..27a60fcb55 --- /dev/null +++ b/simple-interest.sh @@ -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: +# + +# 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