In: Computer Science
pseudocode
display "Please enter first name: " input fName display "Please enter middle initial (Enter space if none): " input mName display "Please enter last name: " input lName display "Enter hours worked: " input hours display "Enter hourly rate: " input perHourRate weeklySalary = hours * perHourRate output "fName mName. lName" output weeklySalary
Question 1. Move your algorithm/pseudocode/outline into Code:Blocks and create a "shell" program. (The shell program shouldn't do any of the final work, but it should have comments where the final code will go and should compile and run.)
#!/bin/bash
# GNU bash, version 4.3.46
# Weekly Slary Program in Bash Shell
echo "Program to Calculate the Weekly Salary !!!"
# In the case of shell script. There is no need to declare a string variable explicitly. when we assign a value to its reference, it will be automatically declared
# SAMPLE = "Hello World"
# echo $SAMPLE
# User is asked to enter his First Name ,
#The read command can be used to prompt the user to enter a
variable
#read -p "Enter Your First Name: " fname
#echo "Welcome $fname!"
# User is asked to enter his Middle Name / Initial
# User is asked to enter his Last Name
# User is asked to enter no. of hours worked and store it in
variable hours
# For sample I have assumed it to be 40
declare -i hours
hours=40
# User is asked to enter his hourly salary rate and store it in
perHourRate
# For sample I have assumed it to be 5
declare -i perHourRate
perHourRate=5
weeklySalary=$((hours*perHourRate))
echo $weeklySalary