Lab Work - Lab 2 Assessment v4

.docx

School

Victoria University *

*We aren’t endorsed by this school

Course

VIT1202

Subject

Mechanical Engineering

Date

Apr 3, 2024

Type

docx

Pages

2

Uploaded by AmbassadorStingrayMaster1152

Report
VIT1202 – Operating Systems Laboratory Work – Lab 2 Assessment Shell Scripting Task 1: (1 mark) Write a shell script named displayTax.sh to get the pay amount from the user and then display the correct tax rate based on the following pay levels: Pay Level Tax Rate 100000+ 43% 80000+ 32% 32000+ 22% <= 32000 0% Task 2: (1 mark) Write a bash shell script named numbers.sh to display the numbers 1 to 10. You must use a “for loop” in your solution. Task 3: (1 mark) Create a bash shell script named doubleNumbers.sh Comment your script with: Author name, Date created and program description The Script displays the number and doubling of the number. Change permission for the script display so that it can be executed. Make screenshots of the script (the program and the output) and paste it in the answer page: Number = 1, Number Doubled = 2 Number = 2, Number Doubled = 4 Number = 3, Number Doubled = 6 Number=10, Number Doubled = 20 Task 4: (1 mark) In your user home directory, create the new text file named cities.txt with the content as below: Athens Paris London Melbourne Tokyo Create the new script named city search.sh in your user home directory which performs the following tasks: The script is required to prompt the user to enter a city or q to quit. On input of a city name, the script will search the file for the city, and if it exists in the file, print a message the city is found otherwise print a message city is not found. The script uses a loop construct to provide the user with continuous searches. Once the user enters ‘q’ to quit, the script should end execution. Date: 5/10/2023 Author: Stefan Batsas File: f11bf65f1eb5db03f7657bfe69566fd92476fd23.docx
VIT1202 – Operating Systems Example output: Submit your solution script files in one .zip or .rar file to the Laboratory Work – Lab 2 drop box by the submission deadline. Date: 5/10/2023 Author: Stefan Batsas File: f11bf65f1eb5db03f7657bfe69566fd92476fd23.docx
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help