NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#!/bin/bash
SalesPerson=(); #name given as given in brief
QuartrlySales=(); #name given as brief

function val_sorting { #function created named as val_sorting
for (( i = 0; i < ${#QuartrlySales[@]} ; i++ )) #for condition is used hereto check value from user
do #continue
for (( j = 1; j < ${#qsalexit[@]} ; j++ )) #for conditon is used again to check value
do #continue

if [[ ${QuartrlySales[j-1]} -lt ${QuartrlySales[$j]} ]]; #if statements is used here
then #condition proceed
t=${QuartrlySales[$j]} #value decleared
QuartrlySales[$j]=${QuartrlySales[$j-1]} ##process proceed
QuartrlySales[$j-1]=$t #quarterly saled value procees

tm="${SalesPerson[$j]}"; #process continues
SalesPerson[$j]="${SalesPerson[$j-1]}"; #avalue of sales person decleartion
SalesPerson[$j-1]="$tm"; #process go on to next step
fi #if condition is end here
done #condineue
done #continue



#Desplayed into the screen
echo -e "nnum will be listed in ascending order:" #number will be ssorted into the screen
for (( i=0; i < ${#SalesPerson[@]}; i++ )) #for condition is used
do # continue
echo "${SalesPerson[$i]} :${QuartrlySales[$i]}" #name of sales person and his quarterly sales will be displayed into the screen
done # break
}


listing_option() { #option toliar the menus item
clear
echo " V I E W - O P T I O N" #message that will display in screen
echo "1. Please!. Input name of SalesPerson" #input that should be given by user
echo "2. Name of SalesPerson is listed" #which view the name of sales person
echo "3. Quit the Program" #get out of the program
read -p "Selete the number between 1 to 3 as you want to have"; #choice that should be made from user

case $choice in #choicece given in tthe program
1) inserting_value ;; #name of function created
2) val_sorting ;; #function name
3) exit ;; #to exit from programm
*) echo -e "${RED}Error...${STD}" && sleep 2 #sleep and error
esac #end
}

function inserting_value { #function inserting_value is created
while [[ true ]]; do #cntinue
while [[ true ]]; #continue
do
read -p "Please!. Input name of Sales Person: " name #message which tells to input namme of sales peron
if [[ $name =~ ^[a-z|A-Z]+$ ]]; then #if condition is used


SalesPerson[${#SalesPerson[@]}]=$name; # inserting value of veriable insde created array

read -p "Quarterly sales of the same SalesPerson : " num # giving the quarterly sales of the same salesperson which is entered before
if [[ $num =~ ^[0-9]*.?[0-9]+$ ]] # Condition for either float number or positive integer number
then
QuartrlySales[${#QuartrlySales[@]}]=$num; #if condition works as per the user input value will be stored ina array
if [[ $num -gt 1000000 ]] #checking of condition used
then
(( bnus=$num + 1500 )) #condition used for bonus
elif [[ ($num -lt 999999) && ($num -gt 100000) ]] #if-else condition checking for bonus
then #continue
(( bnus=$num + 750 )) #condition proceed
else #continue
(( bnus=$num)) #condiroion proceed further more
fi #end of if statements
break; #end
else #default
echo "Decleare correct Amount"; ##message whcih will be displayed in the screen

fi #if condition end here
else #default
echo "Please give correct name"; #shown in the screen
fi #close of if statement
done; #break
echo "Name of the salesperson is : $name and his salary along with bonus as per his QuartrlySales is: $bnus " ;
echo "Press Y/y to continue or any key to end";
read choice; #reads the input taken from user
choice="^[Yy]$"; #choice from user is given here
if [[ $choice =~ $choice ]]; # if condition is used to check the user input value
then #continue

continue; #ends of statements or condition

else # program procees


echo "Thanks"; #messagethat will be displayed on the screen
break; #end

fi #end of if statements
done #break

}
while [[ true ]]; do #userinput value is checked and confirmmed
listing_option; #start
echo "Wanna continue this program?"; #message which will displayed at end of program
read choice; #inpput from user is read by program
choice="^[Yy]$"; #read choice
if [[ $choice =~ $choice ]]; # if condition is checked
then #continue

continue; #end

else #default or otherwise


echo "Thanks for your co-ordination."; #message which will be displaying into the scereeen
break; #end

fi #end os if statements
done #end
     
 
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.