NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#!/bin/bash
#bonus.sh

readSalesperson()
{
echo "Enter the number of salesperson:"
read input
if [[ $input =~ ^[0-9]*$ ]]
then
readn
else
readSalesPerson
fi
}
readn()
{
for (( a = 0; a < $input; a++ ))
do
echo "Enter the name of sales person $a: "
read salesname
if [[ $salesname =~ ^[A-Z|a-z]+$ ]]
then
name1[$a]="$salesname"

echo "Enter quarterlysales of a person $a: "
read quarterlysales1
if [[ $quarterlysales1 =~ ^[0-9]*$ ]]
then
quarterly1[$a]="$quarterlysales1"
fi


else
readn
fi

if [[ $quarterlysales1 -gt 1000000 ]]
then
bonus[$a]="1,500"
elif [[ $quarterlysales1 -le 999999 && $quarterlysales1 -ge 1000000 ]]
then
bonus[$a]="750"
elif [[ $quarterlysales1 -le 99999 ]]
then
bonus[$a]="0"
fi
done
displayname
displayname >> savedarjun.txt
}

displayname()
{
for (( a = 0; a < $input; a++ ))
do
echo "Names:" ${name1[@]}
echo "Quarterlysales:" ${quarterly1[@]}
echo "Bonus:" ${bonus[@]}
option
done

}
option(){
echo "Press S for sorting sales and A for alphabetic"
read input
if [[ $input =~ ^[A]$ ]] || [[ $input =~ ^[a]$ ]]
then
bubbleSort1
elif [[ $input =~ ^[S]$ ]] || [[ $input =~ ^[s]$ ]] s
then
bubbleSort
else
exit
fi
}
bubbleSort()
{
n=${#quarterly1[@]}
for ((k=0;k<$n;k++))
do
for ((l=0;l<$n;l++))
do
if [[ ${quarterly1[l]} -lt ${quarterly1[$((l+1))]} ]]
then
t=${quarterly1[$j]}
quarterly[$l]=${quarterly1[$((l+1))]}
quarterly[$((l+1))]=$t

t1=${name1[$l]}
name[$l]=${name1[$((l+1))]}
name[$((l+1))]=$t1
fi
done
done
echo ${name1[*]}
echo ${quarterly1[*]}
}

bubbleSort1()
{
n=${#name1[@]}
for ((k=0;k<$n;k++))
do
for ((l=0;l<$n;l++))
do
if [[ ${name1[l]} > ${name1[$((l+1))]} ]]
then
t=${name1[$l]}
name[$l]=${name1[$((l+1))]}
name[$((l+1))]=$t

t1=${quarterly1[$j]}
quarterly[$j]=${quarterly1[$((l+1))]}
quarterly[$((l+1))]=$t1
fi
done
done
echo ${name1[*]}
echo ${quarterly1[*]}
}


continue()
{
echo "Do you want to continue?Press[Yy]"
read continue
if [[ $continue =~ ^[Y]$ ]] || [[ $continue =~ ^[y]$ ]]
then
clear
Salesperson
else
exit
fi
}
readSalesperson
     
 
what is notes.io
 

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

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.