Notes
Notes - notes.io |
#taking inputs form the user
echo "Do you want to continue (y/n)"
read go
while [[ "$go" != "n" ]] #function where user may use yes or no
do
funclength() #function of length
{
echo -n "Enter the lenght of the rectangle in cm: "
read -n10 l #taking the input of length which was insert by user
if [[ $l =~ ^[0-9]+.?[0-9]*$ ]]; then #taking only number from user not any alphabetical letter
echo "width of a rectangle is $l cm"
else
echo -n "(Enter number)"
funclength #end function length
#read l
fi
}
funclength
funcbreadth() #function of breadth
{
echo -n "Enter the breadth of the rectangle in cm: "
read -n10 b #taking the input of breadth which was insert by user
if [[ $b =~ ^[0-9]+.?[0-9]*$ ]]; then #taking only number from user not any alphabetical letter
echo "height of rectangle is $b cm"
else
echo -n "(Enter number)" #if user put alphabetical word then input may ask enter number to execute the program
funcbredth
#read b
fi
}
funcbreadth
echo " Area of the rectangle is : $l * $b " #print the value of length and breadth of rectangle
A=`echo $l * $b |bc` #calculate the rectangle in cm
echo "Area of the rectangle in cm = $A cm" #show the final output of area of rectangle
I=`echo $A / 2.54 |bc` #calculate the area of rectangle in inch
echo "Area of rectangle in inch = $I inch " #show the input in inch form
echo "Do you want to continue? (y/n)" #user can be continue or end the function
read go
done
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team