Skip to content

Commit

Permalink
initial files
Browse files Browse the repository at this point in the history
Signed-off-by: Upkar Lidder <[email protected]>
  • Loading branch information
Upkar Lidder committed Jan 12, 2022
1 parent ddd1795 commit 8689746
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
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._
26 changes: 26 additions & 0 deletions simple-interest.sh
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

0 comments on commit 8689746

Please sign in to comment.