Notes
![]() ![]() Notes - notes.io |
(
decision=y
read -p "Enter the number of person: " n
while [ $decision="y" ]; do
echo "Enter your name"
read name
echo "Enter your sales"
read sale
declare -a name_array
declare -a sale_array
name_array+=($name)
sale_array+=($sale)
# bonus_array+=($bonus)
# if [[ "$sale" -ge 1000000 ]]; then
# bon='$sale + 1500'
# elif [[ "$sale" -ge 100000 && "$sale" -le 999999 ]]; then
# bon='$sale + 750'
# else
# bon='$sale'
# fi
echo "do you want to continue (y/n)"
read decision
if [ "$decision" != "y" ]
then
for (( i = 0; i < $n ; i++ ))
do
for (( j = $i; j < $n; j++ ))
do
if [ ${sale_array[$i]} -gt ${sale_array[$j]} ];
then
sell=${sale_array[$i]}
sale_array[$i]=${sale_array[$j]}
sale_array[$j]=$sell
saleman=${name_array[$i]}
name_array[$i]=${name_array[$j]}
name_array[$j]=$saleman
fi
done
done
# if [[ ${sale_array[i]} > 10000 ]]; then
# echo "${name_array[i]}, ${sale_array[i]}"
for (( i=0; i < $n; i++ ))
do
if [[ ${sale_array[$i]} -ge 1000000 ]]
then
(( sale_array[$i]=${sale_array[$i]} + 1500 ))
elif [[ ${sale_array[$i]} -gt 100000 && ${sale_array[$i]} -lt 999999 ]]; then
(( sale_array[$i]=${sale_array[$i]} + 750 ))
else
((sale_array[$i]=${sale_array[$i]}))
fi
echo "${name_array[i]}, ${sale_array[i]}"
done
# for sale in ${!sale_array[@]}
# do
# echo "${name_array[$name]} has earned ${sale_array[$sale]}"
# done
# for (( i = 1; i < 2; i++ ));
# do
# echo "${name_array[@]}, ${sale_array[@]}"
# done
exit
fi
done
)
![]() |
Notes is a web-based application for online 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 14 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