Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i need to write a script in VI editor that will allow a user totype in a number,

ID: 3615652 • Letter: I

Question

i need to write a script in VI editor that will allow a user totype in a number, while the program outputs that number inwords. Example, if you typed in 21, the computer wouldrespond with twenty-one. Please allow the program to work for0-30. If a number typed in is not in that range, be sure tolet the user know.

and also need to write a script with If Statementthat will allow the user to type in a month, then the program willrespond with the holiday in that month. (You only need tolist 1 holiday per month.) If there is no holiday, then havethe computer respond there is no holiday in this month. Alsolet the user know if they typed a month that does not exist.

Explanation / Answer

//Hope this will help you if [ $# -ne 1 ]thenecho "Usage: $0 number"echo " I will print the word of given number "exit 1fisd=0n=$1num=$1if [ $num -lt 0 -o $num -gt 30 ]thenecho "Out of range number "fiif [ $num -eq 0 ]thenecho "Zero"fisd=`expr $n % 10`n=`expr $n / 10`if [ $n -eq 2 ]thenecho -n "Twenty-"fi;if [ $n -eq 0 -o $n -eq 2 ]thenif [ $sd -eq 1 ]thenecho "one"fi;if [ $sd -eq 2 ]thenecho "two"fi;if [ $sd -eq 3 ]thenecho "three"fi;if [ $sd -eq 4 ]thenecho "four"fi;if [ $sd -eq 5 ]thenecho "five"fi;if [ $sd -eq 6 ]thenecho "six"fi;if [ $sd -eq 7 ]thenecho "seven"fi;if [ $sd -eq 8 ]thenecho "eight"fi;if [ $sd -eq 9 ]thenecho "nine"fi;elseif [ $num -eq 11 ]thenecho "Eleven"fi;if [ $num -eq 12 ]thenecho "Tweleve"fi;if [ $num -eq 13 ]thenecho "Thirteen"fi;if [ $num -eq 14 ]thenecho "Fourteen"fi;if [ $num -eq 15 ]thenecho "Fifteen"fi;if [ $num -eq 16 ]thenecho "Sixteen"fi;if [ $num -eq 17 ]thenecho "Seventeen"fi;if [ $num -eq 18 ]thenecho "Eighteen"fi;if [ $num -eq 19 ]thenecho "Nitnteen"fi;if [ $num -eq 10 ]thenecho "Ten"fi;fi;