Question: its not working !/bin/sh a=0.0 b=0 while : do echo 'Enter Employee Category(C,P or S. 0 to Quit): ' read varname if [ $varname ==

 its not working !/bin/sh a=0.0 b=0 while : do echo 'Enter

its not working

!/bin/sh a=0.0 b=0 while : do echo 'Enter Employee Category(C,P or S. 0 to Quit): ' read varname if [ $varname == "0" ] then break elif [$varname == "C"] then a=8.25 elif [ $varname == "P" ] then a=12.50 elif [ $varname == "S" ] then a=20.00 fi echo 'Enter hours worked:' read hours b=$hours echo "Calculated weekly pay @ $a/hr:" sum= '$a * $b' | bc echo " " echo " " done

(40%) 4. Write a complete bash script to calculate weekly pay for employees. (YOU MUST INCLUDE THE SCRIPT FILE (.sh file) IN THE ZIP) Here are the criteria...... a. The script MUST CONTINUE in a loop until user decides to stop. User stops the pay calculations by entering 0. b. Pay is calculated based on a 'category' of the employee. There are three categories and each category has a pay rate, and they are Casual[C]: rate = $8.25/hr Permanent(P): rate = $12.50/hr Staff[S]: rate = $20.00/hr C. User enters the category of the employee (C, P or S) and then the Hours/week (do not worry about overtime hours etc. PS: If the user enters an unknown option, show an error message (Look at the screen dump below) d. Script must run a menu as follows ABC Enterprises - Weekly Pay Calculation Process Enter Employee Category (C, P or S. O to quit): Enter hours worked: Script must produce the calculated result as: Calculated Weekly Pay @rate/hr = $ 99999.99 Here is a dump of an actual run.... ABC Enterprises - Weekly Pay Calculation Process Enter Employee Category (C, P or s. 0 to quit): C Enter hours worked: 32 Calculated Weekly Pay 08.25/hr = $ 264.00 ABC Enterprises - Weekly Pay Calculation Process Enter Employee Category (C, P or s. O to quit): P Enter hours worked: 45 calculated Weekly Pay @12.5/hr = $ 562.5 ABC Enterprises - Weekly Pay Calculation Process Enter Employee Category (C, P or s. 0 to quit): s Enter hours worked: 37 calculated Weekly Pay @20.0/hr = $ 740.0 ABC Enterprises - Weekly Pay Calculation Process Enter Employee Category (C, P or s. O to quit): A sorry unknown option! ABC Enterprises Weekly Pay Calculation Process Enter Employee Category (C, P or s. O to quit): 0 Thank you, Bye

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!