Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a bash script called options that acts as a simple administration menu. Example output: Welcome to the BASH options menu Option 1. Quit

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

1. Write a bash script called options that acts as a simple administration menu. Example output: Welcome to the BASH options menu Option 1. Quit out of this program Option 2. Show this menu Option 3. Subtract number 1 from number 2 option 4. Divide number 1 by number 2 option 5. Output your student number along with your student name Marks breakdown: - 2 marks if script clears screen before beginning - 1 mark for each option that works as it's supposed to - 1 mark if an error is shown when an invalid option is entered - 5 marks if the script runs without error - 2 marks for proper comments Bonus: Should continue to run until option 1, and only option 1 is selected. If someone attempts to quit using ctrl-c the script should prompt the user to use option 1 to exit. (2 marks) 2. Write a bash script called daysinamonth that will ask the user to enter in a year followed by a month and then output how many days will be in that month Example output: Please start by entering in a year between 1900 and 2021 ( 1 to exit) 2001 This is not a leap year :( Please enter in a month to see how many days there are February February has 28 days in this year Please start by entering in a year between 1900 and 2021 ( -1 to exit) 2000 This is a leap year! Please enter in a month to see how many days there are February February has 29 days in this year Please start by entering in a year between 1900 and 2021 ( - 1 to exit) To determine whether a year is a leap year, follow these steps: 1. If the year is evenly divisible by 4 , go to step 2 . Otherwise, go to step 5 . 2. If the year is evenly divisible by 100 , go to step 3 . Otherwise, go to step 4. 3. If the year is evenly divisible by 400 , go to step 4 . Otherwise, go to step 5 . 4. The year is a leap year (it has 366 days). 5. The year is not a leap year (it has 365 days). Marks breakdown: - 2 marks if script clears screen before beginning - 2 marks if script exits when - 1 is entered as a year and continues running otherwise - 2 marks if script errors out when an invalid year is entered (Before 1900 or after the current year) - 5 marks if a leap year is correctly identified - 2 marks for the correct number of days shown for each month - 2 marks if an error is shown when an invalid month is entered - k marks if the number of days in February changes based on if it's a leap year or not - 5 marks if the script runs without error - 2 marks for proper comments Bonus: Ensure the current year is not hard coded into your script and is instead saved into a variable which would change depending on the year in which the user is running the script. ( 2 marks) 3. place it into your home directory on your Ubuntu virtual machine. Test the script using each of the following options (In order) listed below and explain what will happen - If you are getting permission denied when running the script, you need to run the following command: chmod u+x ex: chmod u+x/home/bwilliams/studentlist.sh Do not copy and paste the arguments: 1. new "John Doe1" "A12345673" (1 Marks) 2. new "John Doe2" "A12345673" (2 Marks) 3. new "John Doe1" "A12345674" (1 Marks) 4. new "John Doe3" "A12345675" (1 Marks) 5. list (1 Mark) 6. remove "A12345675" (1 Mark) 7. remove "A1234567356" (2 Marks) 8. new "John Doe3" "A1234567567" (2 Marks) All scripts (options, daysinamonth) las well as the answers to question \#3 in this word document

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What information is provided in a statement of added value?

Answered: 1 week ago

Question

The amount of work I am asked to do is reasonable.

Answered: 1 week ago

Question

The company encourages a balance between work and personal life.

Answered: 1 week ago