Question: Exercise 1 Review Before Trying In the Bash Programming unit, review Basic Syntax and Comparison & Arrays before attempting the assignment below. In the script

Exercise 1
Review Before Trying
In the Bash Programming unit, review Basic Syntax and Comparison
& Arrays before attempting the assignment below.
In the script to the left,
Declare two arrays:
An array called even containing all of the even numbers between 1 and 10.
An array called odd containing all of the odd numbers between 1 and 10.
What is the syntax used to declare an array? Remember, this is an
array of integers, not strings. Do you need to enclose the values in
double quotes? Review the Arrays lesson to find out.
Print the following to stdout:
The 2nd element of the array.
The 5th element of the odd array.
Test #1:
Write a command to test if the 3rd element of the even array is greater than
the 3rd element of the odd array and print the boolean result of the test (1
or 0).
How do you select the Nth element of an array? How do you print a
variable to standard output? Review the lessons in this unit to find
out.
1
out.
Test #2:
Write a command to test if the 4th element of the even array plus the 3rd
element of the odd array is greater than 10.
Use the extended test AND operator && and the echo command to
display This is larger than 10 if this test passes.
Review the Extended Test section in the Bash Programming Unit.
Remember logic and the order of operations, wrapping groups of
operations in parentheses so they occur before the test.
Click the button below to submit
 Exercise 1 Review Before Trying In the Bash Programming unit, review

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!