Project #20364 - Linux Homework

Name _________________________



Programming Project



Instructions:  Do all of the following questions.  Please comment all lines as to show me what is happening.  Also make sure each script runs until the user decides to exit.  Use your  BASH Shell.  In addition to submitting a written copy of the code via the dropbox you MUST also create a folder in your UNIX account named, project.  In that folder should be all of the scripts you wrote for the final project, named final1, final2, etc.  You must also give me read and execute permissions.  If you do not submit your code and allow me to access your scripts you will not receive credit for the final project.  Programs written in other programming languages will not be accepted.  Finally, all scripts MUST loop until the user is done using it.



1. Create a program that will ask the user if they want to add, subtract, multiply or divide two user inputted numbers.  Then give the response as follows:



The sum of number1 and number 2 is: Answer



The difference of number1 and number2 is:  Answer



The product of number1 and number2 is:  Answer



The quotient of Number1 and Number2 is:  Answer



Please note:   ONLY IF the user enters 0 as the second number, let the user know that if they choose divide that a division by zero error will occur.



2. Create a program that will allow a user to type in a number, while the program outputs that number in words.  Example, if you typed in 21, the computer would respond with twenty-one.  Please allow the program to work for 0-30.  If a number typed in is not in that range, be sure to let the user know.



3. Write an If Statement that will allow the user to type in a month, then the program will respond with the holiday in that month.  (You only need to list 1 holiday per month.)  If there is no holiday, then have the computer respond there is no holiday in this month.  Also let the user know if they typed a month that does not exist.



4. Write a program that will allow a user to input as many numbers as the user wants (use "q" as the choice that ends the user input).  The program will then respond:



Highest Number: Answer



Lowest Number: Answer



Sum of the numbers: Answer



Average of the numbers: Answer







5.  Create a Number guessing game.  Have the computer pick a number from 0-60 using the Random Number Generator I provided.  Use the following code as the random number generator.

#Random Number Generator 




let "num %= $RANGE" 

echo $num 

#RANGE=60 sets the RANDOM  number from 0-60 

#the echo $num prints the number


Then allow the user to guess at the number until the user gets it right.  Please include the following:


a) Keep a counter of how many guesses were made, and then tell the user how many guesses it took.



b) As the user guesses, tell the user whether the guess is too high or too low.


6. Write a program that will allow a user to type in a number, then the number will either count up to the number provided by the user or count down from that number.  In addition, create a menu that will let the user choose which counter they wish to use.  In both cases that counter will either count down to 0, or start counting from 0.

Instructions: Enter or paste your written work and/or click "Attachments" to upload 


Subject Computer
Due By (Pacific Time) 12/31/2013 12:00 am
Report DMCA

Chat Now!

out of 1971 reviews

Chat Now!

out of 766 reviews

Chat Now!

out of 1164 reviews

Chat Now!

out of 721 reviews

Chat Now!

out of 1600 reviews

Chat Now!

out of 770 reviews

Chat Now!

out of 766 reviews

Chat Now!

out of 680 reviews
All Rights Reserved. Copyright by - Copyright Policy