Sale!

Task 6 Diamond

$30.00

Category:

Description

5/5 - (2 votes)

# Task 6
### 6a: Diamond – a diamond size is determined by wide of base. A base value must be odd number greater than 3. Your program must validate an odd number input from keyboard.
### 6b: Left-Arrow – left arrow size is determined by two numbers: a length of tail and a wide of base of arrow head. The wide of the base cannot be an even number, and your program should check to make sure that base is always odd number.
### 6c: Right-Arrow – right arrow size is determined by two numbers; length of tail and wide of base of arrow head. The wide of the base cannot be an even number, and your program should check to make sure that base is always odd number.
# Task 7
### Write a script named task7.sh to calculating factorial of given number by using while loop. The shell accepts one integer argument as a parameter and calculates factorial and display the result. Do not use (()) in looping or any value evaluation
# Task 8
### Write a script named “task8.sh” to print given numbers sum of all digit. The shell accept one integer argument as a parameter. Your program must check number of argument is one. If number of argument is not one, your program must display error message and exit.
# Task 9
### Write a Bash shell script named task9.sh that searches for a word in a file as follows:
#### 1. Asks user for a directory in which to find the file.
#### 2. Asks user for the name of a readable file in that directory, giving the user three attempts to name one. If no readable file is named, quits with appropriate error message.
#### 3. Asks user for a word to find in the file. If word is in the file, <word> FOUND! is printed Otherwise, <word> NOT FOUND is printed
#### 4. Exit codes are to be: 0 success, 1 no such directory, 2 no such file (after three attempts), 3 file is not readable, 4 word not found in the file